Show attribute name in template

Author Message

Noicokuna Niemoge

Sunday 18 January 2009 3:03:53 pm

Hi there;

I want to show attribute name in template. I couldn't find it in documentation. My output code looks like:

{if $node.data_map.sound.has_content}
	<div>SOUND :</div> 
	<div>
            {attribute_view_gui attribute=$node.data_map.sound}
        </div>
        {/if}

I want to change "SOUND" so that it displays attribute name. Not content, but just the name which I assigned while creating a class from the set of attributes. I need it because my site is not in English and contains special characters.

Please help.

Shiki soku ze ku...

Stéphane Bullier

Monday 19 January 2009 1:31:50 am

Hello,

You can use this code to inspect the content of node :

 {$node|attribute(show,1)}

In your case, you have to use :

{$node.object.contentobject_attributes[X]}

change X with the id of sound attribute.

Stéphane

Noicokuna Niemoge

Monday 19 January 2009 11:40:14 pm

Thank you very much :)

Shiki soku ze ku...

Gary Teh

Monday 26 January 2009 2:59:17 am

Just in case,. I think more of these template operators could be found on this page as well. :)

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_operators

Cheers
Gary

http://name1price.com : Get a Cool website for yourself and also learn how to manage it. It is easy. Use it to get more customers for your business.

Noicokuna Niemoge

Tuesday 03 February 2009 12:27:34 am

I'm writing again, because I thanked you without checking the operator (it looked very logical). However, it doesn't output the name, there's only blank space. Hmmm.... any help?

EDIT: found it: for reference, it is:

{$node.data_map.(your attribute identifier).contentclass_attribute_name}

Shiki soku ze ku...

Gary Teh

Sunday 08 February 2009 10:43:36 am

Cheers
Always a pleasure to be of help

http://name1price.com : Get a Cool website for yourself and also learn how to manage it. It is easy. Use it to get more customers for your business.

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