| Alexey Borzov 2005-12-16, 7:56 am |
| Hi,
Markus Ernst wrote:
> In my application that uses Template Sigma I have a navigation with the
> sub-navigation nested into the main navigation. The navigation part of
> the template is like this:
>
> <!-- BEGIN navigation_1 -->
> <div class="mainnavi"><a href="{href1}">{name1}</a></div>
> <!-- BEGIN navigation_2 -->
> <div class="subnavi"><a href="{href2}">{name2}</a></div>
> <!-- END navigation_2 -->
> <!-- END navigation_1 -->
>
> Now I need to find a way to hide the level 1 part in some cases, but
> still show the level 2 part. I try to do this with the replaceBlock
> method, but there seems to be a mistake in my approach. This is the
> function I wrote for recursively parsing all levels of navigation (it
> should be applicable for more than 2 levels anyway):
You should introduce another block here containing the stuff you need to
hide:
<!-- BEGIN navigation_1 -->
<!-- BEGIN stuff_to_hide -->
<div class="mainnavi"><a href="{href1}">{name1}</a></div>
<!-- END stuff_to_hide -->
<!-- BEGIN navigation_2 -->
<div class="subnavi"><a href="{href2}">{name2}</a></div>
<!-- END navigation_2 -->
<!-- END navigation_1 -->
And use touchBlock() / hideBlock() on that.
|