Menus - list all pages from first two levels of pages?

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
3/18/2010 8:41:17 AM
Gravatar
Total Posts 5

Menus - list all pages from first two levels of pages?

Hi all!

For a site I'm working on, we'd like to have a horizontal menu showing the first-level pages, and then hover over them to display drop-down menus with the second-level pages. However, we'd like to display anything third-level and below in the side menu (similar to how pages with two horizontal menus work).

I was thinking of just modifying the code presented in the multiple horizontal menu so that it will pull the menus for all the first-level and second-level pages, and then I could use CSS/javascript to create the drop-down menus. However, in the documentation I don't see a way to pull the data for all the second-level pages.

I was wondering if there was a way I could just pull the data for all of the first-level and second-level pages in a theme, and either display it all in a list or organize it in some way? Would anyone happen to know if this is possible?

Thanks!

Joey

3/18/2010 1:38:55 PM
Gravatar
Total Posts 2187

Re: Menus - list all pages from first two levels of pages?

Hi Joey,

We will have to hide the 3rd level and deeper menu items from the SiteMenu using CSS. The side menu can be setup without additional CSS. I am using SuperFish for this example.

1. In your layout.master file, set the SiteMenu control to UseSuperfish=true and UseTreeView=false. Then use the PageMenu control with StartingNodeOffset=2.

<portal:SiteMenu id="SiteMenu1" runat="server"
UseTreeView="false" HideMenuOnSiteMap="false" UseSuperfish="true"
Direction="Horizontal" TopLevelOnly="false" />

<portal:PageMenu id="PageMenu1" runat="server"
UseTreeView="true" StartingNodeOffset="2"/>

2. In your stylemenu.css file, hide menu items below the second level:

.sf-menu ul ul,
.sf-menu ul .sf-sub-indicator{
display:none !important;
visibility: hidden !important;
}

If you are not currently using SuperFish for your dropdown menu:

  1. Copy the stylemenu.css, shadow.png and arrows-ffffff.png files from the Mitchinson-Earthy skin to your skin.
  2. Add the following to your layout.master file directly above the <portal:mojoGoogleAnalyticsScript control.

<portal:SiteScript id="superfish" runat="server" ScriptRelativeToRoot="/ClientScript/jqmojo/mojosuperfish.js" />
<script type="text/javascript">
$(document).ready(function(){
$("ul.sf-menu").supersubs({minWidth:12,maxWidth:27,extraWidth:1}).superfish(
{pathClass:'current',pathLevels:0,speed:'fast'});
});
</script>

HTH,
Joe D.

3/22/2010 10:08:41 AM
Gravatar
Total Posts 5

Re: Menus - list all pages from first two levels of pages?

Hey Joe!

Thanks for your reply! I'm gonna give that a try and I'll let you know how it works. Thanks :D

Joey

3/22/2010 10:16:22 AM
Gravatar
Total Posts 2187

Re: Menus - list all pages from first two levels of pages?

Hi Joey,

Just so you know, the SiteMenu control is going to have a new setting available in the next version of mojoPortal.

You will be able to set DynamicDisplayLevels=1 on the SiteMenu control as shown below. Using this setting, you will not need to hide the other menu levels from the user with the CSS. This will speed up the menu generation and make for cleaner markup.

<portal:SiteMenu id="SiteMenu1" runat="server"
UseTreeView="false" HideMenuOnSiteMap="false" UseSuperfish="true"
Direction="Horizontal" TopLevelOnly="false" DynamicDisplayLevels="1" />

 The feature request for this change is at: http://www.mojoportal.com/Forums/Thread.aspx?pageid=5&mid=34&ItemID=1&thread=5114.

HTH,
Joe D.

You must sign in to post in the forums. This thread is closed to new posts.