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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 20 2025 20:11:49
Script start
Timing: Jan 20 2025 20:11:49
Module start 'layout'
Timing: Jan 20 2025 20:11:49
Module start 'content'
Timing: Jan 20 2025 20:11:49
Module end 'content'
Timing: Jan 20 2025 20:11:49
Script end

Main resources:

Total runtime0.0126 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 587.9141151.2109
Module start 'layout' 0.00440.0023 739.125036.6641
Module start 'content' 0.00670.0044 775.789190.1563
Module end 'content' 0.01110.0014 865.945333.9922
Script end 0.0126  899.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002116.6714140.0002
Check MTime0.00108.2033140.0001
Mysql Total
Database connection0.00075.268910.0007
Mysqli_queries0.002620.424930.0009
Looping result0.00000.088910.0000
Template Total0.00118.910.0011
Template load0.00086.404110.0008
Template processing0.00032.436810.0003
Override
Cache load0.00064.466810.0006
General
dbfile0.00086.421180.0001
String conversion0.00000.041640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs