Formatted output

Author Message

Virgilio Lemos

Wednesday 02 September 2009 1:47:19 pm

I'm developing a page using EzFind where I need to display not only the standard result of a search but also the formated content of the XML block.
I read already all related material, but, of course something is missing because is not working.

Could you help me with the specific code to be inserted at the final of the ezfind_line.tpl?

Here the original ezfind_line.tpl:

{*?template charset=utf-8?*}
<div class="content-view-line">
<div class="class-article float-break">

<div class="attribute-title">
<h2 style="margin-top: 0.5em; margin-bottom: 0.25em"><a href="{$node.global_url_alias}">{$node.name|wash}</a></h2>
</div>

{if is_set( $node.data_map.image )}
{if $node.data_map.image.has_content}
<div class="attribute-image">
{attribute_view_gui image_class=small href=concat( '"', $node.global_url_alias, '"' ) attribute=$node.data_map.image}
</div>
{/if}
{/if}

<div class="attribute-short">
{$node.highlight}
</div>

<div class="attribute-short">
<i>{$node.score_percent|wash}% - <a href="{$node.global_url_alias}">{$node.global_url_alias|shorten(70, '...', 'middle')|wash}</a> - {$node.object.published|l10n(shortdatetime)}</i>
</div>
</div>
</div>

I added the following code at the end of the TLP code but is not working.

<div class="attribute-fetch">
{def $my_node=fetch( 'content', 'node', hash( $node.global_url_alias, $node.name|wash ) )}
{attribute_view_gui attribute=$node.object.data_map.my_node}
{undef $my_node=fetch}
</div>

Thank you in advance,

Regards,
Virgilio

Ɓukasz Serwatka

Thursday 03 September 2009 12:25:18 am

Hi,

Unfortunately your fetch syntax is wrong. Check the documentation for the proper fetch('content', 'node') params. Beside of that I don't see need for that extra fetch. As are as I remember objects returned from eZ Find are extended version of eZContentObjectTreeNode so basically you should access data like

{attribute_view_gui attribute=$node.data_map.ATTRIBUTE_NAME}

P.S Could you use \

 tags for code formatting? Easier to read.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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