Generating a "title" attribute for menu entries

Generating a "title" attribute for menu entries

Wednesday 27 August 2008 4:51:52 am - 4 replies

Modified on Wednesday 27 August 2008 4:58:13 am by Michaël D.

Author Message

Ivo Lukac

Wednesday 27 August 2008 5:44:44 am

Hello

You can do ti like this if your description attribute is simple text:

<a class="{concat('menu_',$i)}" title="{$:item.data_map.description.content}" href={$:item.url_alias|ezurl}>
 

If your description attribute is not simple text (for example online editor text) then you need to strip_tags. About strip_tags you can find out more on this forum.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Michaël D.

Thursday 28 August 2008 12:06:59 am

It's indeed simple text, and your solution works perfectly :-)
Thanks a lot for your help !

André R.

Thursday 28 August 2008 12:31:02 am

Remember to use the wash operator in case the content includes " for instance.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Ivo Lukac

Thursday 28 August 2008 1:06:45 am

Yes, of course:

<a class="{concat('menu_',$i)}" title="{$:item.data_map.description.content|wash}" href={$:item.url_alias|ezurl}>
 

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

You must be logged in to post messages in this topic!

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