Forum
Welcome, Guest
Please Login to access forum.
Re:custom css-class for menu-types alias/separator/heading (1 viewing) 
Go to bottom
TOPIC: Re:custom css-class for menu-types alias/separator/heading
#5757
Ssoft-Solutions, Sven Scheidler
Fresh Boarder
Posts: 2
User Offline
custom css-class for menu-types alias/separator/heading Karma: 0  
Hello,
can your implement a custom css-class for the menu-types alias/separator/heading.
i have this in default_htm_menu.php implemented:

Code:

... foreach ( $this->source->data as $elm ) { $separatorClass=""; // Skip menu external links if($elm->type == 'url' && !$includeExternalLinks) { continue; } $link = $elm->link; if (isset ( $elm->id )) { switch (@$elm->type) { case 'alias' : $link = $elm->link = 'index.php'; break; case 'separator' : case 'heading' : $link = $elm->link = 'index.php'; $separatorClass='class="text-muted"'; break; case 'url' : if (preg_match ( "#^/?index\.php\?#", $link )) { if (strpos ( $link, 'Itemid=' ) === FALSE) { if (strpos ( $link, '?' ) === FALSE) { $link .= '?Itemid=' . $elm->id; } else { $link .= '&amp;Itemid=' . $elm->id; } } } break; default : if (strpos ( $link, 'Itemid=' ) === FALSE) { $link .= '&amp;Itemid=' . $elm->id; } break; } } ... $actlevel = $elm->sublevel; if ($lastlevel == $actlevel) { echo $liclose; echo '<li' . $dataHash . $mergeAliasHash . '>' . '<a '.$separatorClass.' target="' . $openTarget . '" href="' . $link . '">' . $elm->title . '</a>'; $liclose = '</li>'; } else { if ($lastlevel < $actlevel) { echo "<ul>\n"; echo '<li' . $dataHash . $mergeAliasHash . '>' . '<a '.$separatorClass.' target="' . $openTarget . '" href="' . $link . '">' . $elm->title . '</a>'; $liclose = '</li>'; } else { $diff = $lastlevel - $actlevel; for($i = 1; $i <= $diff; $i ++) { echo "</li></ul>\n"; } echo $liclose; echo '<li' . $dataHash . $mergeAliasHash . '>' . '<a '.$separatorClass.' target="' . $openTarget . '" href="' . $link . '">' . $elm->title . '</a>'; $liclose = '</li>'; } } ...
your Boardcode is very bad! regards, Sven
 
Logged Logged  
  The administrator has disabled public write access.
#5759
John Dagelmore
Admin
Posts: 3873
User Offline
Re:custom css-class for menu-types alias/separator/heading Karma: 84  
Hello,

we can plan to add a CSS class in the next release for this kind of elements, however consider to use a Joomla template override to customize it as you need.

Regards,
John
 
Logged Logged  
  The administrator has disabled public write access.
Go to top