[help]xtoc with limited amount of menu

About the template and stylesheet - and changing the menu
Post Reply
avangers
Posts: 5
Joined: Wed May 09, 2012 4:15 am

[help]xtoc with limited amount of menu

Post by avangers » Thu Jun 14, 2012 9:01 am

I want a little help "how to limited amount of xtoc menu?" I will put the xtoc on top menu (horizontal), Because this area have limited lenght area I want to make-xtoc can display only max 5 or 7 menus items, and let the others show menus on the vertical menu (side menu) if I add 8th menu and so on. Someone give me an adviced to made ​​the dropdown menu on top menu, thats a good idea too, but I still want to make-xtoc can restricted amount of menu.
if anyone here can help me? I really appreciate it

best regards
Avangers

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [help]xtoc with limited amount of menu

Post by cmb » Thu Jun 14, 2012 11:54 am

Hi Avangers,

it might be hard to modify xtoc() and toc() to do this, as these functions are already very complex. But there's a simple alternative (that requires more work though): hide the addtional top level pages from the menu, and create their menu structure manually in a newsbox, and call this newsbox in the template.

Or you might consider to restructure the page, so that you have only 5-7 top level pages. If necessary you can have more than 3 menu levels (Settings>CMS>Menu>Levels).

How to make horizontal drop down menus is shown on http://www.cssplay.co.uk/menus/dd_valid.html (perhaps you might try one of the other menus on Stu Nicholls' wonderful site).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: [help]xtoc with limited amount of menu

Post by svasti » Thu Jun 14, 2012 12:06 pm

Hi Avangers

I once had to do something like this, i.e. a split menu, part horizontal, part vertical, see http://www.breuss-dorn-seminare.de.
If you click on "Inhaltsverzeichnis" (sitemap, in the vertical menu 3rd last item), you will see the sitemap and see, that in fact level 1 pages are in the horizontal and vertical menu.

xtoc didn't quite do the job for me, so I modified (quick-n-dirty) it a bit (could send you the code if you insist). May be one day I'll make a plugin from it.
xtoc as it is can add some additional headlines into the menu, but the menu will not be split into two menus. In my example, the menu is split into 3 menus. If I look into the template I find in different div's:
  • <?php echo xtoc(1,1); echo xtoc(2); echo xtoc(3);?>
  • <?php echo xtoc(1,3,2);
  • <?php echo xtoc(1,3,3);
Now I have to remember how I did it :?

Of course Christoph's suggestion is also very good. In a way much easier ... however the sitemap will not show the links in the newsbox, and menumanager will have no effect on your secondary menu.

svasti

Post Reply