Current link

Author Message

Alexander Petrov

Tuesday 04 September 2007 7:03:46 am

I'm trying to code the "current link" template inside the User class. It has child elements in my installation and inside every user there are elements like folders and articles. I want to create a navigation for this.

In my pagelayout template I use this code for detecting the current link :

{let selected=and( count( $module_result.path )|gt(1), eq( $module_result.path[1].node_id, $child.node_id ) )}
<a href={$child.url_alias|ezurl()} title="{$child.name|wash()}" {$selected|choose( '', 'id="current"' )}>{$child.name|wash()}</a>
			{/let}

It works perfectly for main navigation.

But when I put this code inside the folder class I'v created inside Users class group the "current link" does not detects. Can anyone help me with it?!

Thanx!

Alexander Petrov

Tuesday 04 September 2007 12:05:38 pm

Found solution:

<a href={$child.url_alias|ezurl()} title="{$child.name|wash()}" {if $node.node_id|eq( $child.node_id)}id="current"{/if}>{$child.name|wash()}</a>

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

eZ debug

Timing: Jan 30 2025 22:23:14
Script start
Timing: Jan 30 2025 22:23:14
Module start 'layout'
Timing: Jan 30 2025 22:23:14
Module start 'content'
Timing: Jan 30 2025 22:23:14
Module end 'content'
Timing: Jan 30 2025 22:23:14
Script end

Main resources:

Total runtime0.0214 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.0078151.1953
Module start 'layout' 0.00460.0036 739.2031220.6563
Module start 'content' 0.00820.0121 959.8594997.6797
Module end 'content' 0.02020.0011 1,957.539129.9922
Script end 0.0214  1,987.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002310.8862140.0002
Check MTime0.00104.8188140.0001
Mysql Total
Database connection0.00073.307210.0007
Mysqli_queries0.002210.138830.0007
Looping result0.00000.056810.0000
Template Total0.00083.610.0008
Template load0.00062.911810.0006
Template processing0.00020.719610.0002
Override
Cache load0.00042.008410.0004
General
dbfile0.002411.250580.0003
String conversion0.00000.029040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs