Page 1 of 1

[SOLVED] Menu imported from HTML site

Posted: Wed Mar 28, 2012 5:32 pm
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>

Re: Menu imported from HTML site

Posted: Wed Mar 28, 2012 5:53 pm
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>

Re: Menu imported from HTML site

Posted: Wed Mar 28, 2012 6:48 pm
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