here is how to create a menu in a table for horizontal menus - .tpl code inc

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
scotch33
Dev Team Member
Dev Team Member
Posts: 284
Joined: Tue Feb 14, 2006 9:56 pm

here is how to create a menu in a table for horizontal menus - .tpl code inc

Post by scotch33 »

Hi there,

I have just had occasion to create a menu in a table with 1 row and multiple cells - for a horixontal menu with 1 link per cell.  Now I know tables are not good for layout (there's an old argument restarted!) but I was being too lazy to tit about with a horizonlat list on one particular site.  Obviously this'd only work if you have a sinfle level menu, but below is the tpl - customised from a tpl that came with the system.  Enjoy it, for what its worth.

John

{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *}
{if $count > 0}

{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="" times=$node->depth-$node->prevdepth}
{elseif $node->depth prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}

{elseif $node->index > 0}
{/if}

{if $node->current == true}
url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}

{elseif $node->parent == true && $node->depth == 1}
url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}

{elseif $node->type == 'sectionheader'}
{$node->menutext}

{elseif $node->type == 'separator'}


{else}
url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}

{/if}

{/foreach}

{repeat string="" times=$node->depth-1}

{/if}
banana

Re: here is how to create a menu in a table for horizontal menus - .tpl code inc

Post by banana »

Great , it was almost what i am looking for!

Actually i want just text links like this for the header:

link1 | link2 | link3


With no CSS..
Post Reply

Return to “Layout and Design (CSS & HTML)”