Mental block with menus

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Max P

Mental block with menus

Post by Max P »

Hi

Yes, I know, that subject again, but after spending hours going throught the help docs and trying the templates I am having difficulty with a basic step in CMSms. I'm sure that others out there will have had a similar issue so please be patient with me.

I have written several static sites using XHTML1.1 and CSS, I understand the very basics of php and I understand page flow and structure. I have used ZenCart and I can now edit the pages within. Anyone who knows ZenCart will probably understand that this is no walk in the park when you first start dabbling.

The only reason that I mention all this is to show that I have some level of competence with web coding so I am staggered that I cannot understand this menu system. Basically, I have kept things simple and used my own template (I haven't uploaded all of the images yet so the right hand part of the header will still be blank).

You can view it here http://www.i-dl.com/pmc

You will see that I have made a real pig's ear of the menu and that I have one horizontal menu and one vertical. I have read that the pages are added to the menu using the parent if the page is a child and none if the page is not. I am used to using the tag and assigning a class, I prefer this to classes but I could change back if necessary. Building static pages I am used to creating the navigation within the code ( I hand code both the XHTML and CSS using Notepad++ ) so the whole idea of taking a menu away from the content is new to me.

I know that to many users here this will be backward, so; is there any documentation anywhere that will give me the syntax that I require to achieve this simple task?

Form what I understand, I call the {menu} smarty in the layout code, then I have to make sure that my div ids and classes are defined in the css code. But, does the {menu} smarty call a particular menu ie simple or do I have to define the {menu} call more specifically? Once I have the menu formatted in a row without text styling I'll be laughing.

I have been through the docs thoroughly so please do not think that this constitutes laziness on my part!

Please help I'm starting to doubt my own sanity.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Mental block with menus

Post by calguy1000 »

CMS Made simple's menumanager automatically builds a list of linksfrom the page hierarchy you created in Content >> Pages,  It has numerous parameters to control what menus are generated, and is entirely template driven so that the output can be controlled any way you want.  The advantages to this system, is that with a well thought out design, you can easily add content to your site without having to re-visit every page to re-create the navigation, or fool with some 'include' file or something.  You could even allow other users to create content and the menu could be built automatically.

The default menumanager templates use and ..... but there's nothing stopping you from creating a menumanager template that just uses links.  I personally don't like the way that the default menumanager templates put opening inside of a ..... it's a preference thing, so I've created a menumanager template (somewhere) that doesn't do this, but still works for numerous levels of menus.

Now..... I'm not sure exactly what you want, but lets go with this scenario:

a) You want a horizontal menu that's the same on all pages
b) you want a vertical menu that shows the current page, and it's children.
c) your page heirarchy is something like:
    page 1
      child 1.1
      child 1.2
      child 1.3
    page 2
      child 2.1
      child 2.2
          child 2.2.1
          child 2.2.2
      child 2.3
    page 3
      child 3.1
      child 3.2
      child 3.3

You would need two menu calls:
The horizontal menu would be something like:  {menu number_of_levels='1'} to just output the top level.  of course, I would wrap that in a div, like:  {menu number_of_levels='1'}

The vertical menu would be something like: {menu start_page='$page_alias} to start at the current page and work down.  Again, I would wrap this in a div like: {menu start_page=$page_alias}

With the vertical menu you may want to play with the number_of_levels, and the 'collapse' parameters to the menu call so that the items you want are exactly controlled.  Use 'view source' alot until you get the hang of it.

You should easily be able to style up these menus to appear exactly the way you want..... and then, as you add content, you won't have to go through and modify each page to re-create the navigation.

if, for example you wanted to change the horizontal menu so that it output just a flat list of anchors with a different class name for each element.... you could easily create a stripped down, trimmed out menumanager template that would only work for one level of menus, but outputs a flat list of links.... no problems.  it'd involve just removing all the and stuff from the smarty template, and calling that appropriate template on your horzontal menu call.  i.e:
{menu template='my_stripped_template' number_of_levels='1'}

Hope this gets you started.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Max P

Re: Mental block with menus

Post by Max P »

Fantastic, I begin to see how it works now. Thank you for your time in this matter, I did not expect a dev team member to help me solve such a low level problem. Once I have this menu cracked I shall certainly be sticking with this cms. I did take a look at typo3 and silverstripe (Drupal and Joomla were too 'heavy') but I can see how this system just pips them to the post, otherwise, it's a minefield out there!
Locked

Return to “CMSMS Core”