Getting the section name of specified node

Author Message

Piotr Kwiatkowski

Friday 08 October 2004 5:10:30 am

Hi,

How to get the section name of node?

I want to override my template for folder class with my own (showing the search result). And I want to present:
1. Publish date
2. Folder name
3. Section name of specifed folder

I have got following code:

<th>{$node.object.published|l10n(shortdate)}</th>
<th><a href={$node.url_alias|ezurl}>{attribute_view_gui attribute=$node.object.data_map.name}</a></th>
<th>{$node.object.section_name|wash}</th>

Analogical to default I have changed the {$node.object.class_name|wash} to {$node.object.section_name|wash}. But it does not work. Published date and folder name works fine, but as I said section name is missing.

UPDATE:
I have found the section ID: {$node.object.section_id}.
So how to get the section name having a saction ID in template?

Thanks for help.

Lida Popelo

Friday 08 October 2004 1:30:10 pm

Hello Piotr Kwiatkowski,

Try this :

{let sectionobj=fetch( 'section', 'object', hash( 'section_id', 1 ) )}
    {$sectionobj.name}
{/let}

i found this information here:
http://ez.no/ez_publish/documentation/reference/data_fetching/section/object

Piotr Kwiatkowski

Saturday 09 October 2004 12:36:48 pm

Thanks, works fine.

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