This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » top_menu.tpl -> can this be dynamic?
expandshrink

top_menu.tpl -> can this be dynamic?

top_menu.tpl -> can this be dynamic?

Tuesday 08 July 2003 11:58:54 am - 5 replies

Everybody knows 'top_menu.tpl' (in the demo). It's the template which contains the menu with the links to every 'subsite'.
But, what if there are... let's say... 10 subsites (and counting!!) and I don't always want to change top_menu.tpl manually.

I want to place a pulldownmenu in top_menu.tpl which contains all the links to the 'subsites' and I want the links to be generated dynamically. Is it possible to do this (using ezP codes; {, }, etc.)? That way I don't always have to change the top_menu.tpl manually.

Tnx, Mark

[edit]
If this does not exist, maybe I can program it myself, but I need to know how and where the folders are saved (tables in db).
[/edit]

Modified on Tuesday 08 July 2003 2:11:45 pm by Mark Overduin

Tuesday 08 July 2003 2:32:21 pm

If your sites are objects in the root of eZ publish, e.g. folders, you can fetch them with a normal fetch function in eZ publish.

See:
http://ez.no/developer/ez_publish...entation/customization/custom_design
The documents database connectivity and examples shows how you can do this.

--bård

Wednesday 09 July 2003 9:33:02 am

I managed to get the objects out of a folder in Root, but not the objects IN Root.

My code:
----------
{let folder_list=fetch( content, list, hash(
parent_node_id, 126,
sort_by, array( array( priority ))
)
)
}

<select>
{section name=Folder loop=$folder_list}
<option value="/content/view/full/{$Folder:item.node_id}">{$Folder:item.name|wash}</option>
{/section}
</select>
----------

...where 126 is the ID of the folder in Root.

What needs to be changed to 'receive' the objects in Root?

Wednesday 09 July 2003 9:59:11 am

*** removed ***

Somehow, my reply ended up above Bård's reply...

Modified on Wednesday 09 July 2003 10:07:08 am by Mark Overduin

Wednesday 09 July 2003 10:00:27 am

Normally 2 is the ID of the root folder, if you've used the standard SQL files.

Mabye you can try this.

--bård

Wednesday 09 July 2003 10:06:07 am

Thank you very, very much. This works. Excellent!

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from