[SOLVED] Menu imported from HTML site

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.
Post Reply
brooksie
New Member
New Member
Posts: 7
Joined: Sun Jun 05, 2011 10:44 pm

[SOLVED] Menu imported from HTML site

Post by brooksie »

Hi folks

I have another question regarding menus.

If I can refer you to my original (temporary) HTML site http://www.keithbrook.com, you'll notice that the active menu tab is white, to match the page, which looks good in my view.

Now, have a look at http://www.brooksie.com/keithbrook-cmsms and you'll see that I've understood pretty well how to import a site. Thanks, CMS Made Simple.

However, I have an issue with the active menu tab on this second site. I appear to have got the menu installed but not the 'active' part.

I have a feeling it's something to do with 'menuactive' (oh really?) but I don't know how to change it safely.

I'm using version 1.10.3.

Can anyone help me?

Many thanks

Brooksie

--------------------------------

Here is the menu snippet in the HTML site:

Code: Select all


<div class="krb-bar krb-nav">
<div class="krb-nav-outer">
<div class="krb-nav-wrapper">
<div class="krb-nav-inner">
	<ul class="krb-hmenu">
		<li>
			<a href="./index.html" class="active">Home</a>
		</li>	
		<li>
			<a href="./size.html">Size Matters</a>
		</li>	
		<li>
			<a href="./costs.html">Costs</a>
		</li>	
		<li>
			<a href="./safety.html">Safety</a>
		</li>	
		<li>
			<a href="./contact.html">Contact</a>
		</li>	
	</ul>
</div>
</div>
</div>
</div>
and here is the menu snippet in the CMSMS site:

Code: Select all

<div class="krb-bar krb-nav">
<div class="krb-nav-outer">
<div class="krb-nav-wrapper">
<div class="krb-nav-inner">

{menu template='keithbrook'}

</div>
</div>
</div>
</div>

I used 'import' to make a copy of simple_navigation.tpl called 'keithbrook' and changed <ul>. Here's part of it:

Code: Select all

<ul class="krb-hmenu">

{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}
  {assign var='classes' value='menuactive'}
  {if $node->parent == true}
    {assign var='classes' value='menuactive menuparent'}
  {/if}
  {if $node->children_exist == true and $node->depth < $number_of_levels}
    {assign var='classes' value=$classes|cat:' parent'}
  {/if}
  <li class="{$classes}"><a class="{$classes}" href="{$node->url}"><span>{$node->menutext}</span></a>
Last edited by brooksie on Wed Mar 28, 2012 6:49 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu imported from HTML site

Post by Dr.CSS »

Whatever CSS controls the white on the active tab in original site use menuactive on CMSMS site...

<li class="menuactive"><a class="menuactive" href="http://brooksie.com/keithbrook-cmsms/"> ... </span></a>
brooksie
New Member
New Member
Posts: 7
Joined: Sun Jun 05, 2011 10:44 pm

Re: Menu imported from HTML site

Post by brooksie »

Doc, you're a genius, and fast too!!

I wasn't quite sure if I should make the css match the menu or the other way round, but I got it first time as it happens.

Many thanks

Brooksie
Post Reply

Return to “CMSMS Core”