Missing something really obvious

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
electrifire
Forum Members
Forum Members
Posts: 48
Joined: Sun Feb 28, 2010 3:53 pm

Missing something really obvious

Post by electrifire »

I think I've missed something really obvious and need some guidance.

I've created my default page which works fine and I've also created a 2nd content page but I've no idea how to link to it or how it should appear in the menu structure.

In my template I'm using the {cms_module module="menumanager"} and in the menu layout I assumed the menu would be created automatically from the pages (where you give the page a name and tick to appear in the menu) but it doesnt.  Have I assumed wrong and I should be coding the menumanager like this


        Home 
           
            Electrical
            Fire Alarm
            Intruder
            Access Control
            CCTV
            Maintenance
            Gallery
       
   


Once a page is created and set to active how do I find the page?
uniqu3

Re: Missing something really obvious

Post by uniqu3 »

Hi,

i think this could help you answer your questions.
http://wiki.cmsmadesimple.org/index.php ... nu_Manager

The menu is include with {menu}
You also have other functions that you can include for example a template you built in MenuManager would be called
{menu template='yourtemplate'}
electrifire
Forum Members
Forum Members
Posts: 48
Joined: Sun Feb 28, 2010 3:53 pm

Re: Missing something really obvious

Post by electrifire »

thanks but I already have a menu structure I should have said Im porting my website over to cmsms and I wasnt sure if the menu was being created on the fly or does the page just call for menu manager code?

And where are the pages I create?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Missing something really obvious

Post by jmcgin51 »

By default, the menu is created from your list of (a) active and (b) marked as "show in menu" pages.  Some menus automatically expand to show children, others won't show the children until you're on the parent page itself.

No need to hand-code a menu.  That's one of the beauties of a CMS.

all you need is {menu} in your template, where you want the menu to appear.

If you started with the default content from a new CMSms install, it discusses the menu management.  Well worth reading.
electrifire
Forum Members
Forum Members
Posts: 48
Joined: Sun Feb 28, 2010 3:53 pm

Re: Missing something really obvious

Post by electrifire »

Ok so the content must be in a database, hence why I couldn't find it through ftp etc.

Unfortunately I've deleted the original content but in my template I have this:


{cms_module module="menumanager"}


should this just be {menu} ?

That may explain why nothing seems to show up when I add pages etc.

In the menu manager do I need to add css details or will it get that info from the {stylesheet} ?

Thanks
uniqu3

Re: Missing something really obvious

Post by uniqu3 »

Yes you need to call it {menu}

About style it depends how you have written your CSS.
The menu is built with unordered list so if your original menu looked like

Code: Select all

<div id="menu">
<ul>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
And your CSS is written something like:

Code: Select all

#menu {your:style;}
#menu ul {your:style;}
#menu ul li {your:style;}
#menu ul li a:link, #menu ul li a:visited{your:style;} 
and so on...

It should display correctly.
electrifire
Forum Members
Forum Members
Posts: 48
Joined: Sun Feb 28, 2010 3:53 pm

Re: Missing something really obvious

Post by electrifire »

thats exactly how my original menu is written, but if I just add the css to menu manager it displays all the css on the page not the menu but if I hard code it like:



Link
Link


it displays fine, the style sheet has all the css for the menu, I cant seem to work out what should go in the menu manager, I dont think its for css and I dont think its for hard coding the menu yet it I leave it blank nothing shows up
uniqu3

Re: Missing something really obvious

Post by uniqu3 »

Make a Temaplate in Menu manager like name it Menu or something

Code: Select all

{if $count > 0}
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li><a class="current" {elseif $node->current == true}
<li><a class="current" {elseif $node->haschildren == true}
<li><a {elseif $node->type == 'sectionheader'}
<li>{$node->menutext} {elseif $node->type == 'separator'}
<li> <br />{else}
<li><a {/if} {if $node->type != 'sectionheader' and $node->type != 'separator'}href="{$node->url}" {if $node->accesskey != ''}accesskey="{$node->accesskey}" {/if}{if $node->tabindex != ''}tabindex="{$node->tabindex}" {/if}{if $node->titleattribute != ''}title="{$node->titleattribute}"{/if}{if $node->target ne ""} target="{$node->target}"{/if}><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>{/if}{/foreach}{repeat string="</li></ul>" times=$node->depth-1}</li></ul>
{/if}
After that open your Template and call the menu:

Code: Select all

<div id="menu">
{menu template='Menu'}
</div>
Now the pages that you made in CMS should display in menu.
If everything will display correctly depends on your CSS, do you have a multilevel menu and subpages or not.
You could first call your menu with {menu template='Menu' number_of_levels='1'} to display only 1st level pages and than work your way forward to submenus.
electrifire
Forum Members
Forum Members
Posts: 48
Joined: Sun Feb 28, 2010 3:53 pm

Re: Missing something really obvious

Post by electrifire »

Sorry to be slow here cms is very new to me, I added the code as you said and this is how the menu should look

www.electrifire.co.uk

and this is how it looks:

www.electrifire.co.uk/test

For some reason the style isnt there buy its in the css file so Im confused?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Missing something really obvious

Post by jmcgin51 »

make sure the stylesheet is attached to your page template

May I recommend that you do a new clean install of CMSms (make sure to install the default content), and read through the default pages, especially related to the Menu Manager.

(note that if you install over your existing site, all existing content will be erased)
uniqu3

Re: Missing something really obvious

Post by uniqu3 »

When i look at your stylesheet i do not see #menu in your CMSMS stylesheet but i do see it in your original site.
This could be the problem?

@jmcgin51 why should he do clean install the cms works just fine, it's templating that causes problems :-)
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Missing something really obvious

Post by jmcgin51 »

I think he would benefit from reading the default content.  Plus, it doesn't sound like he's done much development on the site so far, so he wouldn't be taking much of a step backward.

Also the easiest way to restore the default templates, menu templates, stylesheets, etc.

If I were in his shoes, I would reinstall.  That's my suggestion.
electrifire
Forum Members
Forum Members
Posts: 48
Joined: Sun Feb 28, 2010 3:53 pm

Re: Missing something really obvious

Post by electrifire »

Yep sorry I had cut the menu code from the style sheet when I thought it should go into the menu manager, its now there and looks fine, just 1 more thing the menu buttons have numbers before the text, how would I remove that?

www.electrifire.co.uk/test
uniqu3

Re: Missing something really obvious

Post by uniqu3 »

include Accessibility stylesheet that was include in default installation or add to your css

Code: Select all

dfn{display:none;}
electrifire
Forum Members
Forum Members
Posts: 48
Joined: Sun Feb 28, 2010 3:53 pm

Re: Missing something really obvious

Post by electrifire »

magic thanks for you help  ;D

I'm trying to align the menu structure central as it doesn't fill the whole wide but what ever I do it wont centre I think there's to much padding on the right but I cant seem to change it.

What part should I be changing?

#menu{ height:37px; width:100%; padding:0 0px 5px 0;}
#menu ul{ list-style:none;}
#menu ul li{ display:block; float:left; background:url(images/bord.gif) no-repeat top right; padding:0 1px 0 0;}
#menu ul li.right{ background:none;}
#menu ul li a{ float:left; background:url(images/menu.gif) repeat-x 0 0; height:37px; font:bold 10.5px/37px Arial;color:#828373; text-decoration:none; padding:0 18px;}
#menu ul li a.left{ background-position: 0 -111px; padding:0 25px 0 32px;}
#menu ul li a.right{ background-position: right -148px; padding:0 32px 0 25px;}

#menu ul li a:hover,#menu ul li a.active{ background-position:0 -37px; color:#fff;}
#menu ul li a.left:hover,#menu ul li a.left.active{ background-position: 0 -74px!important;}
#menu ul li a.right:hover,#menu ul li a.right.active{ background-position: right -184px;}
dfn{display:none;}
Last edited by electrifire on Thu Mar 11, 2010 7:47 pm, edited 1 time in total.
Post Reply

Return to “Layout and Design (CSS & HTML)”