By: fatalterror
Date: 2009-10-23
Time: 08:41
|
Merging block problem + check mechanism
Hi,
Here’s the simple code…
PHP:
$TBS->MergeBlock('menu',$connection,'SELECT * FROM '.$menu.' WHERE child_id = 0 ORDER BY sort_id');
$TBS->MergeBlock('submenu',$connection,'SELECT * FROM '.$menu.' WHERE child_id = %p1% ORDER BY sort_id');
$TBS->MergeBlock('subsubmenu',$connection,'SELECT * FROM '.$menu.' WHERE child_id = %p1% ORDER BY sort_id');
|
HTML:
<ul>
<li><a href="#" class="velos">[menu.title;block=li;]</a>
<ul>
<li><a href="#">[submenu.title;p1=[menu.id];bmagnet=ul;block=li;]</a>
<ul>
<li><a href="#">[subsubmenu.title;p1=[submenu.id];bmagnet=ul;block=li;]</a></li>
</ul>
</li>
</ul>
</li>
</ul>
|
I was wondering if there is any way to remove the class=”velos” when there is no submenus? And attach the class when there is a submenu under the root level?
In other words I would like to check if there is submenu or subsubmenu and then apply the class=”velos” to the menu block...
thanks
|