Forums / Setup & design / Use of rssexport_list variable

Use of rssexport_list variable

Author Message

Jean-Philippe Schneider

Thursday 12 October 2006 1:29:02 am

Hi there!

I'm setting up a intranet site, and I want to override design/standard/templates/link.tpl in order to add < link / > of RSS feeds. I tried to use

{section name=RSSExport loop=$rssexport_list}
<link rel="alternate" type="application/rss+xml" title={$RSSExport:item.title|wash} href={concat("rss/feed/",$RSSExport:item.access_url)|ezurl} />
{/section}

This code part is similar to the one in design/admin/templates/rss/list.tpl. But in my override, the variable rssexport_list doesn't seems to be defined.

Does somebody have an idea?

Thanks

JPS

Claudia Kosny

Thursday 12 October 2006 5:20:48 am

Hi JPS

This variable is created by the file
\kernel\rss\list.php

which then calls the rss/list template.

I don't think there is way to fetch the list from within a template, so the easiest thing might be to just create your own templateoperator which does that for you.
If you have a look at the file you can see that the code for creating the list is really simple:

// Get all RSS Exports
$exportArray = eZRSSExport::fetchList();
$exportList = array();
foreach( array_keys( $exportArray ) as $exportID )
{
    $export =& $exportArray[$exportID];
    $exportList[$export->attribute( 'id' )] =& $export;
}

// Get all RSS imports
$importArray = eZRSSImport::fetchList();
$importList = array();
foreach( array_keys( $importArray ) as $importID )
{
    $import =& $importArray[$importID];
    $importList[$import->attribute( 'id' )] =& $import;
}

Here you can find information how to create a template operator:
http://ez.no/products/ez_publish/documentation/development/extensions/template_operator

If you need help with that just ask, but it is really easy.

Greetings from Luxembourg

Claudia

Jean-Philippe Schneider

Thursday 12 October 2006 7:49:33 am

From France to Luxembourg : Thanks !

Now It just does what I want!

Perfect :)

Really thank you

JPS