Dynamic Links?????

Author Message

Douglas Johnson

Friday 11 July 2003 1:18:44 pm

How can I create dynamic links based on the users previous link selections? Example: I have a template with 3 navigation areas. A top horizontal nav bar, a left nav bar and a right nav bar. The user selects "link 1" on the top nav bar, this changes the left nav bar links. I realize this can be done by linking each nav bar link to a separate template but I don't want to create dozens of templates. How can I "capture" the users node selection and based on that, link to the appropriate child? Thanks in advance.

Karsten Jennissen

Friday 11 July 2003 1:47:29 pm

Hi,

you can do that by using a site hierarchy where each main node under the root folder has a set of sub nodes and where the main nodes are displayed in the top nav and the sub nodes of each main node is displayed in the left nav. Seems to me that this is kind of what you want, right?

Anyway, with this hierarchy it is easy to just use one template. In the top nav you use a fetch with parent node of the root folder + section loop over the result. In the left nav you do a fetch of all nodes where the parent node is the currently selected node + a section loop over the results.

If you have no clue what I am talking about :-), take a look here:
http://ez.no/developer/ez_publish_3/documentation/customization/custom_design
and here:
http://ez.no/developer/ez_publish_3/documentation/customization/tips_tricks

Karsten

Douglas Johnson

Friday 11 July 2003 2:18:45 pm

Ok, I think I understand.....but how do I get the ID of the currently selected node? Please bare with me:-) I'm new to all of this. Thanks.

Karsten Jennissen

Friday 11 July 2003 2:40:22 pm

You can get the current node_id with
{$module_result.node_id}

Some more info here:
http://ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/fetching_the_id_of_the_parent

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 21:33:13
Script start
Timing: Jan 30 2025 21:33:13
Module start 'layout'
Timing: Jan 30 2025 21:33:13
Module start 'content'
Timing: Jan 30 2025 21:33:13
Module end 'content'
Timing: Jan 30 2025 21:33:13
Script end

Main resources:

Total runtime0.0240 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.0000151.1953
Module start 'layout' 0.00620.0045 739.1953220.6406
Module start 'content' 0.01070.0118 959.8359997.6328
Module end 'content' 0.02250.0014 1,957.468833.9922
Script end 0.0240  1,991.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.7825140.0002
Check MTime0.00104.0051140.0001
Mysql Total
Database connection0.00104.149110.0010
Mysqli_queries0.003514.743930.0012
Looping result0.00000.050710.0000
Template Total0.00104.210.0010
Template load0.00073.066410.0007
Template processing0.00031.154210.0003
Override
Cache load0.00052.178410.0005
General
dbfile0.00124.834580.0001
String conversion0.00000.042740.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