eZ Community » Forums » eZ Publish 5 Platform » Get current item in a menu
expandshrink

Get current item in a menu

Get current item in a menu

Wednesday 13 November 2013 4:41:53 pm - 1 reply

Hi All,
I remember in eZ Publish 4, we can define our current item (for example in a menu) with a {$node.path_array.xx} and compare this with current content :

 {foreach $items as $item}
 
{if eq($item.path_array.xx, $node.path_array.xx)}
 
This is my current item
 
{else}
 
This is not my current item
 
{/if}
 
{/foreach}

Well, now, in eZ Publish 5, I'm pretty sure we can use a similar method but, I don't found any documentation or similar cases in this forum :

{% for location in locationList %}
           <li class="nav-location-{{ location.id }}">
                 <a href="{{ path( location ) }}" title="{{ location.contentInfo.name }}">
                        {{ location.contentInfo.name }}
                  </a>  
            </li>
{% endfor %}

The only data that I miss is the global variable (like $node in eZ Publish4) to compare this with my location.id.

Can you help me ?

Regards

Thursday 14 November 2013 3:05:20 pm

Hi,

i think you search for the ezpublish helper :

 {{ dump(ezpublish.systemUriString) }}

 

will help u.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from