Home / ez@work / Einfachen RSS-Block implementieren (ezFlow-Feedreader)

Einfachen RSS-Block implementieren (ezFlow-Feedreader)

Einen FeedBlock definieren in block.ini.append.php 

 
[RSSFeedReader]
Name=RSS Feed (automatisch)
ManualAddingOfItems=disabled
CustomAttributes[]
CustomAttributes[]=source
CustomAttributeTypes[source]=string
CustomAttributes[]=limit
CustomAttributeTypes[limit]=string
CustomAttributes[]=offset
CustomAttributeTypes[offset]=string
ViewList[]=rssfeed_reader
ViewName[rssfeed_reader]=RSS Feed
 
ZoneIdentifier[]
ZoneIdentifier[]=middle
ZoneIdentifier[]=left
ZoneIdentifier[]=right
 
### Default START ###
CustomAttributes[]=Boxueberschrift
CustomAttributeTypes[Boxueberschrift]=text
 
### Default END ###
 
 

Ein Feedblock-Template erstellen in override/templates/block/rssfeed_reader.tpl

{cache-block expiry=300 keys=array($block.custom_attributes.source, $block.custom_attributes.limit, $block.custom_attributes.offset)}
{def $source = $block.custom_attributes.source
$limit = $block.custom_attributes.limit
$offset = $block.custom_attributes.offset
$res = feedreader( $source, $limit, $offset )
$valid_nodes = $block.valid_nodes
}
<div class="block-view {if ne($block_position,'middle')}block-small-view rss-box{else}block-large-view{/if}">
{include uri='design:tools/eZFlow_headerline.tpl' block=$block valid_nodes=$valid_nodes}
<ul class="nospace noindent">
{foreach $res.items as $item}
<li>
<a href="{$item.links[0]}" title="{$item.title|wash()}">{$item.title|wash()}</a>
</li>
{/foreach}
</ul>
</div>
{/cache-block}
{undef $valid_nodes}

Kommentare

Feed-Description im Tooltip (RSS Browser-like)

Einfach die Linkzeile in feedreader.tpl (override/templates/block) wie folgt ändern:

<a href="{$item.links[0]}" title="{$item.description|striptags|wash()}">{$item.title|wash()}</a>

striptags ist hier wichtig. Ist nicht standardmäßig aktiviert (ezp2011.9), also hier einstellen:
template.ini unter [PHP]:
PHPOperatorList[striptags]=strip_tags


Bitte melden Sie sich an oder registrieren Sie sich um kommentieren zu können.

 

© 2011 by lbm-services.de - All rights reserved.

Valid XHTML 1.0 Transitional