PDA


View Full Version : Simple Navigation Menu Modification...


Jaxel
02-24-2006, 12:55 PM
I never liked the default nav menu that came with CMPS, however, I managed to edit it enough so now it looks pretty good... This mod only supports 2 levels of links.

For an example of it: http://www.crookedjester.com/

In /modules/navigation.php REPLACE:
if ($npage['level'] <= 1)
{
$navmark = $mod_options['portal_navigation_mark1'];
}
else
{
$navmark = str_repeat('&nbsp;', (intval($npage['level'] - 1))) . $mod_options['portal_navigation_mark2'];
}and if ($navlinks['level'] <= 1)
{
$navmark = $mod_options['portal_navigation_mark1'];
}
else
{
$navmark = str_repeat('&nbsp;', intval($navlinks['level'] - 1)) . $mod_options['portal_navigation_mark2'];
}WITH$navmark1 = $mod_options['portal_navigation_mark1'];
$navmark2 = $mod_options['portal_navigation_mark2'];In Template > vbAdvanced CMPS > adv_portal_navigation REPLACE EVERYTHING with:$customnavigationbits
$navigationbitsIn Template > vbAdvanced CMPS > adv_portal_navigationbits REPLACE EVERYTHING with:<if condition="$npage['level'] <= 1 AND $navlinks['level'] <= 1">
<tr><td class="thead" align="center">$navmark1<if condition="$link"><a href="$link" style="text-decoration: none">$title</a><else />$title</if>$navmark2</td></tr>
<else />
<tr><td class="$bgclass" align="center"><span class="smallfont"><if condition="$link"><a href="$link" style="text-decoration: none">$title</a><else />$title</if></span></td></tr>
</if>With this simple mod, navigation will look nicer. This mod uses the two navmarks for the left and right side of the first level. If you check my site: http://www.crookedjester.com/, I have the 2 navmarks as &raquo;&nbsp;&nbsp; and &nbsp;&nbsp;&laquo;

CoolHandLuke
05-10-2006, 08:38 PM
Ok I installed this hack and it appears to work. However, my menu items are not underlined like yours. How do I incorperate that?

Thanks,
Luke

CoolHandLuke
05-12-2006, 07:04 PM
Ok I have figured this out on my own. It is really quite simple. Look at this code:


<if condition="$npage['level'] <= 1 AND $navlinks['level'] <= 1">
<tr><td class="thead" align="center">$navmark1<if condition="$link"><a href="$link" style="text-decoration: none">$title</a><else />$title</if>$navmark2</td></tr>
<else />
<tr><td class="$bgclass" align="center"><span class="smallfont"><if condition="$link"><a href="$link" style="text-decoration: none">$title</a><else />$title</if></span></td></tr>
</if>


See this line:


<tr><td class="thead" align="center">$navmark1<if condition="$link"><a href="$link" style="text-decoration: none">$title</a><else />$title</if>$navmark2</td></tr>


The td class="thead" represents the tabe cells CSS style. You can change it to suit. So what I did was I used "tcat" instean of "thead" on the divisions where I wanted the same table cell background as the top. You can see a example of this @ might site. However I will be moving the site to the main level once it is complete.

http://www.canuckclan.com/

Luke

jruerph
05-21-2006, 06:48 AM
Thanks for the "simple" navigation module. It's definitely an upgrade from the default CMPS nav module and I don't need all the bells and whistles of some of the other nav hacks availabe.