Forums / Setup & design / top_menu.tpl -> can this be dynamic?

top_menu.tpl -> can this be dynamic?

Author Message

Mark Overduin

Tuesday 08 July 2003 2:58:54 am

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]

Bård Farstad

Tuesday 08 July 2003 5:32:21 am

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_3/documentation/customization/custom_design
The documents database connectivity and examples shows how you can do this.

--bård

Documentation: http://ez.no/doc

Mark Overduin

Wednesday 09 July 2003 12: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?

Mark Overduin

Wednesday 09 July 2003 12:59:11 am

*** removed ***

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

Bård Farstad

Wednesday 09 July 2003 1: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

Documentation: http://ez.no/doc

Mark Overduin

Wednesday 09 July 2003 1:06:07 am

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