[ic] Show/hide sub-navigation?
Jeff Dafoe
interchange-users@icdevgroup.org
Mon Oct 28 21:53:01 2002
I have the functionality you describe and I used a ghetto solution. At
the top of the category_vertical I do a:
[tmp matchstring][value-extended name=mv_searchspec joiner=" | "][/tmp]
Then in category_vertical right above the loop that displays the cats I
do:
[tmp disp_subnav]0[/tmp]
[if scratch matchstring =~ /[box-data area name]/i]
[tmp disp_subnav]1[/tmp]
[/if]
[if scratch disp_subnav == 1]
<cat loop here>
[/if]
Jeff
----- Original Message -----
From: "Thomas J.M. Burton" <tom@globalfocusdm.com>
To: <interchange-users@icdevgroup.org>
Sent: Monday, October 28, 2002 7:50 PM
Subject: [ic] Show/hide sub-navigation?
> Hello,
>
> I'm attempting to add a sub-navigation level to the category_vertical
component and
> have so far been unsuccessful. What I'd like to do is take the links that
are added
> under the area titles in the foundation demo and hide them unless the user
is in that
> area of the site.
>
> Example:
>
> The navbar on the left would contain the following:
>
> Bracelets
> Earrings
> Necklaces
>
> Each area being a link (simple search) to that category of items. If a
user clicks on
> Earrings, the navigation would then expand like so:
>
> Bracelets
> Earrings
> Gold
> Silver
> Diamond
> Cubic Zirconia
> Necklaces
>
>
> My approach was to set a scratch value on the results or flypage pages and
compare
> that in the loop that builds the navigation list. So far I haven't been
able to get
> that comparison to work in the category_vertical component. Here's what I
have:
>
> *snip*
> [set found_cat][/set]
> [loop
> prefix=box
> search="
> fi=area
> st=db
> tf=sort
> ac=0
> ac=0
> co=yes
>
> sf=sel
> op=eq
> se=[control set_selector left]
>
> sf=which_page
> op=rm
> se=[control page_class all|@@MV_PAGE@@]
> "]
> <div class="nav1">[box-exec bar_link]area[/box-exec]</div>
>
> [set found_cat]1[/set]
> <!--
> [perl]
> $parentDb = area;
> $parentField = prod_group;
> $parentCode = "[box-code]";
> [/perl]
> -->
>
> //
> // This is where I'm trying to compare the current loop item's name to
scratch sectID
> //
>
> [if data area::name::[box-code] =~ /[scratch sectID]/]
> [loop prefix=cat
> search="
> fi=cat
> st=db
> tf=sort
> tf=name
> rf=code,name
> sf=sel
> se=[box-code]
> "]
>
> <div class="nav2">[cat-exec nav2_link]cat[/cat-exec]</div>
>
> [/loop]
> [/if]
> [/loop]
> *snip*
>
> It seems that the [scratch sectID] is not being interpolated within the if
tag. I've
> tried writing the if using Perl tags, but I'm not sure if I got the syntax
right.
> What's the right way to go about this?
>
> I'm running IC 4.8.6.
> For a visual example, go to http://ght.gfdm.net/cgi-bin/ght
>
>
> Thanks,
> Tom Burton
> ___________________________________
> Thomas J.M. Burton, Design/Production
> Global Focus Digital Media, LLC
> www.globalfocusdm.com
> [541] 342.5717
>
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>