For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > December 2005 > Re: [PEAR] Sigma and nested blocks: replace outer block by inner









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Sigma and nested blocks: replace outer block by inner
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.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com