Forums / Setup & design / NEED HELP : customizing menu "flat_left.tpl"

NEED HELP : customizing menu "flat_left.tpl"

Author Message

Fabrice Girardot

Thursday 23 September 2004 2:11:25 am

Hi,

I am a newbie with eZ Publish and my english is the worst english you had to read: so please not be rude with me ;-)

I want to customize the left menu, so, do I copy

design/base/templates/menu/flat_left.tpl

to

design/[my site]/templates/menu/flat_left.tpl

? but it doesn't seems to work, maybe modify an .ini file? or what ?

Thank you

--
Fabrice

Nicolas Heiringhoff

Thursday 23 September 2004 2:45:01 am

Hello Fabrice,

this should be simple: you copy

design/base/templates/menu/flat_left.tpl

to

design/[my site]/templates/menu/flat_left.tpl

Now you have to call the new template with

{include uri="design/[my site]/templates/menu/flat_left.tpl"}

after you modified the template (design/[my site]/templates/menu/flat_left.tpl) the modifications should be visible

Nico

http://www.heiringhoff.de

Fabrice Girardot

Thursday 23 September 2004 3:03:25 am

Thank you Nicolas,

but... what about all the code in pagelayout.tpl about menus :


    <div id="columns">

        {menu name=LeftMenu}

        <hr class="hide" />
    {/cache-block}

    . . .

        {cache-block}
            {let maincontentstyle='maincontent-bothmenus'}

            {section show=eq(ezini('SelectedMenu','LeftMenu','menu.ini'),'')}
                {set maincontentstyle='maincontent-noleftmenu'}
            {/section}

            . . .

            <div id="maincontent" class="{$maincontentstyle}">
                <div id="fix">
                    <div id="maincontent-design">
            {/let}

        {/cache-block}

Do I simply throw all these lines ? Or may be there is a "cleaner way" ?

Thank you

--
Fabrice

Nicolas Heiringhoff

Thursday 23 September 2004 3:36:02 am

I just notized that the flat_left.tpl menu template is a little different from the normal menu template that i use.
I started with eZ 3.3.5 and this code served me well ever since:



{* Set your top category here *}
{let top_cat=74
     used_node=false()}

{* See if we have already a node id otherwise use the top category as current node *}
{section show=is_set($DesignKeys:used.node)}
        {set used_node=$DesignKeys:used.node}
{section-else}
        {set used_node=$top_cat}
{/section}

{* Get a proper node object *}
{let node_obj=fetch(content,node,hash(node_id,$used_node))}

<!-- Hier endet das Hauptmenü-->


{* FIRST LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$top_cat, class_filter_type, "include", class_filter_array, array(1),sort_by,array(array(priority))))}
                        {section show=eq($:item.node_id,$used_node)}
                        <span class="aktuell">
                         &raquo;
                        {section-else}
                        {section show=$node_obj.path_array|contains($:item.node_id)}
                        <span class="aktuell">
                         &raquo;
                        {/section}
                        {/section}
<a class="hauptmenu" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></span>&nbsp;&nbsp;

        
{/section}


 <td align="right" class="datum">{include uri="design/iddisweb/templates/datum.tpl"}</td>

<!-- Hier endet das Hauptmenü-->

<br>
<!-- Hier beginnt das Untermenü-->


<table width="990" border="0" cellspacing="0" cellpadding="0" bgcolor="white">
	<tr height="19">
		<td width="48" height="19"></td>
		<td height="19" class="tabelleuntermenu" bgcolor="#f3f3f3">
		{* FIRST LEVEL *}
		{section loop=fetch(content,list,hash(parent_node_id,$top_cat, class_filter_type, "include", class_filter_array, array(1),sort_by,array(array(priority))))}

        	{* SECOND LEVEL *}
        	{section show=$node_obj.path_array|contains($:item.node_id) loop=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1),sort_by,array(array(priority))))}
        	                        {section show=eq($:item.node_id,$used_node)}
        	                        <span class="aktuell">
                         &raquo;
                        {section-else}
                        {section show=$node_obj.path_array|contains($:item.node_id)}
                        <span class="aktuell">
                         &raquo;
                      
                        {/section}
                        {/section}
                <a class="untermenu" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></span>&nbsp;

          
        	{/section}
		{/section}
		</td>
		<td width="48" height="19"></td>
	</tr>
</table>





<!-- Hier endet das Untermenü-->

{/let}
{/let}


where "74" is the number of the node, where the menu structure begins.

Sorry, I do not have modified the flat_left.tpl, but if you use the code above you do not need the other code in the pagelayout.tpl

Nico

http://www.heiringhoff.de

Fabrice Girardot

Thursday 23 September 2004 5:37:04 am

Thank you very much for this help.
I will try how to use the menu flat_left in clean way later. I must go on :-)

But if anybody have knowledge about this, please feel free to contact me mailto:fabrice@mondofragils.net or post an answer here.

--
Fabrice

Nicolas OTTAVI

Friday 23 September 2005 9:06:47 am

Hi Fabrice,

I am also a beginner,

{menu LeftMenu} will tell to the template to go and check the left menu file as it is configured in menu.ini.

So go and check your /settings/siteaccess/[your site]/menu.ini.append.php and let me know what you can see.

This is what I have

[MenuSettings]
AvailableMenuArray[]
AvailableMenuArray[]=TopOnly
AvailableMenuArray[]=LeftOnly
AvailableMenuArray[]=DoubleTop
AvailableMenuArray[]=LeftTop

[SelectedMenu]
CurrentMenu=LeftOnly
TopMenu=
LeftMenu=flat_left

[TopOnly]
TitleText=Only top menu
MenuThumbnail=menu/top_only.jpg
TopMenu=flat_top
LeftMenu=

[LeftOnly]
TitleText=Left menu
MenuThumbnail=menu/left_only.jpg
TopMenu=
LeftMenu=flat_left

Do you have the same ? If no, this could be the answer to your question

Bye,
C.