Suckerfish Dropdown menu

Author Message

Lydie Soler

Tuesday 26 July 2005 5:37:05 am

Hi,

I am trying to install the dropdown menu.
It says that I need to use 'the double_top.tpl file as the navigation template override'
Can someone tell me exactly which tpl file I need to override?
I can't find the double_top file to override with the admin interface....

Thanks for your help

Lydie

Lydie Soler

Tuesday 26 July 2005 9:30:50 am

this template seems to be in the design/base/templates/menu directory.

I know how to override templates in the standard directory. But How do I do this for this template?

Lydie

Luc Chase

Thursday 28 July 2005 4:45:30 am

Lydie,
You only need to override if you are going to make changes to the default template and/or to when it is used.

You have several options:-
1. To override a .tpl in design/base/templates/menu
put the override in either design/base/overrides/templates/menu
or to make it siteAccess specific... in
design/<siteAccess>/overrides/templates/menu
in each case naming the override file the same as the file being overriden.
The above would override the original for all cases i.e. no class, section or node_id conditions.

2nd Option: Open your overrides.ini (or overrides.ini.append.php) in an editor and study its structure. Using the overrides.ini file you can name the overriding template anythingYouLike.tpl, you can put it in special folders, you can optionally add conditions relating to when it should be used such as in certain sections, or only with certain content classes or only with a specific node_id.
Bear in mind that the more specific the override condition the higher up the override.ini file it should be. The rule is... The first condition in the winning overrides.ini[.append][.php] to be met is the winner.
Tip: The bits in square brackets are just arbitrary lables but in the spirit of self-documentation they should be explanatory and/or match the name of the overriding template.
Tip 2: 'Subdir=' is the base or root directory within the site-access (and not a subdirectory of that) i.e. where to start looking for the .tpl . So, if you then place the .tpl in a directory below that you have to specify that in the 'MatchFile=' value e.g.
MatchFile = menu/myDoubleTop.tpl
Subdir = templates

Remember you may need to clear cache.
Enable Template debugging to verify that you are overriding correctly.

The Web Application Service Provider

Lydie Soler

Thursday 28 July 2005 6:31:18 am

Thanks for the answer.

Today I have installed the 3.6.1 and this file can now be seen using the admin interface so there no problem for me anymore.

Thanks a lot for your help

Lydie Soler

Thursday 28 July 2005 6:53:32 am

For your information the dropdown menu work fine in 3.6.1 but I have noticed an error..
at the end the closing tags let and section are messed up.

here is the correct file:

{let top_cat=2
     used_node=false()}
        {set used_node=2}
{let node_obj=fetch(content,node,hash(node_id,$used_node))}
<ul id="nav">	

{* 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))))}
{let child_check=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}<li><a {section show=$child_check|count|gt(0)}{/section} href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>

{* SECOND LEVEL *}
		{let openol_check1=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}
		                {section show=$openol_check1|count|gt(0)}<UL>{/section} 
								
        {section 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))))}
		{let child_check1=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}
		                <li><a {section show=$child_check1|count|gt(0)}class="daddy"{/section} href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>

{* THIRD LEVEL *}
				{section show=$child_check1|count|gt(0)}<ul>{/section}
                {section 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))))}
				{let child_check2=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}
		                <li><a {section show=$child_check2|count|gt(0)}class="daddy"{/section} href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
						
{* FOURTH LEVEL *}
						{section show=$child_check2|count|gt(0)}<ul>{/section}
                        {section 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))))}
                                <li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
                        {/section}
						{section show=$child_check2|count|gt(0)}</ul>{/section}						
						</li>
					   {/let}
                {/section}
				{section show=$child_check1|count|gt(0)}</ul>{/section}</li>{/let}
               {/section}
		 {section show=$openol_check1|count|gt(0)}</UL>{/section} 
		 </li>{/let}
{/let}
{/section}

 </ul>
{/let}
{/let}

Martin Kristiansen

Monday 15 August 2005 4:48:42 am

Show me the files Suckerfish!

I've installed Suckerfish dropdown menu, and it looks nice, thank's for this nice piece of code!

My installation only shows the folder, and the folders in the folder. I guess that's how Suckerfish works? But I need it to also show me the files in the folders.

Are there any easy solution to this?

Martin

See if I am online
http://mystatus.skype.com/bigclassic/nettmedia

Dive it -Sail it - Blogg it - Its life!
http://frittliv.blogspot.com

Lydie Soler

Tuesday 16 August 2005 8:16:32 am

in the code there is

class_filter_type, "include", class_filter_array, array(1) 

which means folder (if I remember well).

all you have to do is change for something like this:

class_filter_type, "include", class_filter_array, array('folder','article') 

you should find somewhere in the documentation all the possible values for class_filter_array

Charles Tanton

Wednesday 07 December 2005 9:02:03 am

I'm new to eZ publish, so don't understand the hash functions too well yet. I want to specify which folders should be included in the top level of the menu. I'm sure it's something to do with the first fetch:

{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))))}

but I've tried to replace array(1) with an array of all the folder nodes I want included, but that didn't work. Any Ideas?

Charles.

http://www.parkroad.co.za

Mark Marsiglio

Wednesday 07 December 2005 12:44:56 pm

The array(1) is related the class_filter_array and specifies that it should include class_id=1, which is folder. Thus, all folders are included.

In order to show only certain nodes, replace the whole fetch statement with an array of nodes that you want to display.

{let articles=fetch( content, list, hash(node_id, array( $id1, $id2, $id3 ) ) )}

Something like that should work, but I have not tested the code.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Charles Tanton

Wednesday 07 December 2005 9:03:29 pm

Hey Mark. Thanks for your response. I tried to replace the existing fetch statement with what you suggested, but it did not work. This is what I tried:

{section loop=fetch(content,list,hash(node_id,array(120,121,122,123,124,125,126,127)))}

I thought that it might help to have more of the code for you to look at (this is the original which works, but as you said works purely on all folders):

{let top_cat=100
     used_node=false()}
        {set used_node=2}
 {let node_obj=fetch(content,node,hash(node_id,$used_node))}
 <ul id="nav">	

{* 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))))}
{let child_check=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}<li><a {section show=$child_check|count|gt(0)}{/section} href={$:item.url_alias|ezurl}>{$:item.name}</a>

{* SECOND LEVEL *}
		{let openol_check1=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}
		                {section show=$openol_check1|count|gt(0)}<UL>{/section} 
								
        {section 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))))}
		{let child_check1=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}
		                <li><a {section show=$child_check1|count|gt(0)}class="daddy"{/section} href={$:item.url_alias|ezurl}>{$:item.name}</a>

{* THIRD LEVEL *}
				{section show=$child_check1|count|gt(0)}<ul>{/section}
                {section 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))))}
				{let child_check2=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}
		                <li><a {section show=$child_check2|count|gt(0)}class="daddy"{/section} href={$:item.url_alias|ezurl}|ezurl}>{$:item.name}</a>
						
{* FOURTH LEVEL *}
						{section show=$child_check2|count|gt(0)}<ul>{/section}
                        {section 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))))}
                                <li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
								</li>
                        
						{/section}
						{section show=$child_check2|count|gt(0)}</ul>{/section}						
						</li>
					   {/let}
                {/section}
				{section show=$child_check1|count|gt(0)}</ul>{/section}</li>{/let}
               {/section}
		 {section show=$openol_check1|count|gt(0)}</UL>{/section} 
                 </li>{/let}
{/let}
{/section}
 </ul>
{/let}
{/let}

Thanks,

Charles.

http://www.parkroad.co.za

Charles Tanton

Friday 09 December 2005 3:58:16 am

Figured it out from this post:

http://ez.no/community/forum/setup_design/excluding_a_node_from_the_left_hand_menu

This is the code I now use to exclude certain nodes from the top level menu:

{* 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-exclude match=$:item.node_id|eq(102)} 
{section-exclude match=$:item.node_id|eq(92)} 
{section-exclude match=$:item.node_id|eq(115)} 
{section-include match=$:item.node_id|eq(396)}
{let child_check=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1)))}<li><a {section show=$child_check|count|gt(0)}{/section} href={$:item.url_alias|ezurl}>{$:item.name}</a>

http://www.parkroad.co.za

Mark Marsiglio

Friday 09 December 2005 4:44:44 am

I had never seen that solution - thanks for sharing it.

I also thought of a few more ways...
-add a checkbox to the folder class called "Exclude from Nav", then modify your include only items that are not checked
-create a new section, and assign that section to the items that you want to exclued. Then add a section filter to the fetch.
-Add a max=5 to the loop that creates the navigation so that it only shows the first 5 items. The 6th, 7th, and 8th folders would be excluded from the nav.

The solutions have the advantage of not requiring a change in the template code to modify the nav, allowing the content managers control over the nav elements.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Charles Tanton

Friday 09 December 2005 5:09:44 am

Thanks Mark - you're right, it's better not to have to change it in the template. I'm going to give your first option a try and will let you know. Would the code to filter on the folder attribute look something like this (I've never done this kind of filtering before...):

{section loop=fetch(content,list,hash(parent_node_id,$top_cat, class_filter_type, "include", class_filter_array, array(1,2,33),attribute_filter, array( array( "folder/nav_include","=", 1 )),sort_by,array(array(priority))))}

http://www.parkroad.co.za

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.