A Problem with mytmplate

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
MKOracle
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 14, 2012 11:30 am

A Problem with mytmplate

Postby MKOracle » Tue Feb 14, 2012 11:43 am

hello ...
I have a template and it work good until I made a change in the menu . I create a new menu for side bar and the top menu does not work correctly !
karapost.com ... When we click on a certain part in menu , for example 'tracking' , its related page open but the top menu's button must be white ... but its not happen .
what must I done ?

User avatar
spike1968
Joomla! Explorer
Joomla! Explorer
Posts: 427
Joined: Fri Aug 25, 2006 2:39 pm
Location: United Kingdom - Aldershot
Contact:

Re: A Problem with mytmplate

Postby spike1968 » Tue Feb 14, 2012 1:27 pm

Do you have a link to view the problem?
I may be wrong and I often am.
http://www.yourparish.co.uk - Free listing directory
IMHO Chrome is the best

MKOracle
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 14, 2012 11:30 am

Re: A Problem with mytmplate

Postby MKOracle » Tue Feb 14, 2012 1:49 pm

spike1968 wrote:Do you have a link to view the problem?


I Wrote it in first post : www.karapost.com

User avatar
spike1968
Joomla! Explorer
Joomla! Explorer
Posts: 427
Joined: Fri Aug 25, 2006 2:39 pm
Location: United Kingdom - Aldershot
Contact:

Re: A Problem with mytmplate

Postby spike1968 » Tue Feb 14, 2012 1:54 pm

sorry missed it. looking at it now
I may be wrong and I often am.
http://www.yourparish.co.uk - Free listing directory
IMHO Chrome is the best

User avatar
spike1968
Joomla! Explorer
Joomla! Explorer
Posts: 427
Joined: Fri Aug 25, 2006 2:39 pm
Location: United Kingdom - Aldershot
Contact:

Re: A Problem with mytmplate

Postby spike1968 » Tue Feb 14, 2012 2:06 pm

If you take a look at 'view source' in your browser you will see that at line 102 the code

Code: Select all

<li class="active">


is shown for the Home link when you first enter the site.

When you click tracking or other links you will see that this code is missing.

You will need to add

Code: Select all

class="active"
in the li for in your template html folder for mod_menu I would imagine but not 100% sure.

But that is why it won't display the way you want it to.
I may be wrong and I often am.
http://www.yourparish.co.uk - Free listing directory
IMHO Chrome is the best

MKOracle
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 14, 2012 11:30 am

Re: A Problem with mytmplate

Postby MKOracle » Wed Feb 15, 2012 1:07 pm

spike1968 wrote:If you take a look at 'view source' in your browser you will see that at line 102 the code

Code: Select all

<li class="active">


is shown for the Home link when you first enter the site.

When you click tracking or other links you will see that this code is missing.

You will need to add

Code: Select all

class="active"
in the li for in your template html folder for mod_menu I would imagine but not 100% sure.

But that is why it won't display the way you want it to.


yes ... but I want dynamicly change It not static ! witch file I must change ?

User avatar
spike1968
Joomla! Explorer
Joomla! Explorer
Posts: 427
Joined: Fri Aug 25, 2006 2:39 pm
Location: United Kingdom - Aldershot
Contact:

Re: A Problem with mytmplate

Postby spike1968 » Wed Feb 15, 2012 4:58 pm

That I cannot be 100% sure about unless I saw all the files for your site, it could be in you html folder in the template or it could be a core file in joomla code.

Do you have mod_menu listed in your html folder in your template... this can be found at root>template>[template name]>html
I may be wrong and I often am.
http://www.yourparish.co.uk - Free listing directory
IMHO Chrome is the best

MKOracle
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 14, 2012 11:30 am

Re: A Problem with mytmplate

Postby MKOracle » Thu Feb 16, 2012 2:35 pm

this is the relative function in theme :


function mosRecurseListMenu( $id, $level, &$children, $open, &$indents, $class_sfx, $highlight ) {

global $Itemid;

global $HTTP_SERVER_VARS;

if (@$children[$id]) {

$n = min( $level, count( $indents )-1 );

if ($level==0) echo '<ul onmouseover="check_id()">';

else

echo $indents[$n][0];

foreach ($children[$id] as $row) {

switch ($row->type) {

case 'separator':

$row->link = "javascript:;";

break;

case 'url':

if ($row->link == "javascript:;") {

$row->link = "javascript:;";

}

else {

$row->link .= "";

}

break;

default:

$row->link .= "&Itemid=$row->id";

break;

}

$li = "\n".$indents[$n][1] ;

$current_itemid = trim( JRequest::getVar( 'Itemid', 0 ) );

if ($row->link != "seperator" &&

$current_itemid == $row->id ||

$row->id == $highlight ||

(JRoute::_( substr($_SERVER['PHP_SELF'],0,-9) . $row->link)) == $_SERVER['REQUEST_URI'] ||

(JRoute::_( substr($_SERVER['PHP_SELF'],0,-9) . $row->link)) == $HTTP_SERVER_VARS['REQUEST_URI']) {



if ($row->type != "url") {

$li = "<li class=\"active\">";

}



}

echo $li.$row->type;



echo mosGetLink( $row, $level, $class_sfx );

mosRecurseListMenu( $row->id, $level+1, $children, $open, $indents, $class_sfx, "" );

echo $indents[$n][2];



}

echo "\n".$indents[$n][3];



}

}


Return to “Templates for Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 6 guests