PDA

View Full Version : Prevent one category from tree display


Kirk Weick
01-09-07, 04:35 PM
I am trying to prevent the below category from displaying in my Cattree. I have tried many different IF statements but can not figure out the correct sequence. It either does nothing or prevents the whole tree from displaying. This is my first attempt and I'm striking out.


This is the category I want to hide
# variable entity value
1 l.settings:cattree[1]:class &mvt:cattree[1]:class; cat
2 l.settings:cattree[1]:code &mvt:cattree[1]:code; NEW_HERMIT_CRAB_PRODUCTS
3 l.settings:cattree[1]:id &mvt:cattree[1]:id; 23
4 l.settings:cattree[1]:image &mvt:cattree[1]:image; graphics/00000001/newproducts.gif
5 l.settings:cattree[1]:name &mvt:cattree[1]:name; New Store Products



Here is my current cattree:

<mvt:foreach iterator="tree" array="cattree">
<mvt:if expr="l.settings:tree:image">
&mvt:tree:pad;<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code;" class="&mvt:tree:class;"><img src="&mvt:tree:image;" border="0" alt="&mvt:tree:name;"></a><br><br>
<mvt:else>
&mvt:tree:pad;<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code;" class="&mvt:tree:class;">&mvt:tree:name;</a><br><br>
</mvt:if>
</mvt:foreach>

Any help would be appreciated. Thanks.

leslienord
01-09-07, 05:49 PM
Let me know if you get a good solution to this - I'm trying to do something very similar.

Thanks!

sebenza
01-09-07, 06:29 PM
Try this:

<mvt:foreach iterator="tree" array="cattree">
<mvt:if expr="l.settings:tree:code NE 'code'">

<mvt:if expr="l.settings:tree:image">
&mvt:tree:pad;<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code; " class="&mvt:tree:class;"><img src="&mvt:tree:image;" border="0" alt="&mvt:tree:name;"></a><br><br>
<mvt:else>
&mvt:tree:pad;<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code;" class="&mvt:tree:class;">&mvt:tree:name;</a><br><br>
</mvt:if>

</mvt:if>
</mvt:foreach>

Kirk Weick
01-09-07, 06:43 PM
That worked great.
I got close except I was trying to use l.settings:cattree:code and I had a double quote instead of single around the code.

Thanks for the help Scott.

leslienord
01-09-07, 06:47 PM
Ohhhh...this is good. Can it be used in a Category Template instead of the <mvt:item name="cattree" /> token?

Many thanks!!!

dreamingdigital
01-10-07, 06:34 PM
Ohhhh...this is good. Can it be used in a Category Template instead of the <mvt:item name="cattree" /> token?

Many thanks!!!

I don't think so. You'll need Sebenza's module to have control over the category tree. I recommend getting that module anyhow. Scott's added a lot of features to it from easy to complex. Besides, it lets you take out the space after a category tree image and, well, lets you do practically anything to the category tree like add extra spacing, styles, break into groups, etc etc. It's cheap too.

leslienord
01-10-07, 06:36 PM
Yes, I know. I already have the module. I'm wanting to know if I can use the code in lieu of the token - since the module is installed.

leslienord
01-10-07, 11:58 PM
If I can't use the code in place of the token is it possible to do an IF CTGY EQ type statement?

if the category equals A display A
else
if the category equals B display B

or will it just get goofy with the sub-categories?

sebenza
01-11-07, 04:31 PM
I'm wanting to know if I can use the code in lieu of the token - since the module is installed.

Yes. Just replace the item tag with the template code for the tree.

leslienord
01-11-07, 04:50 PM
When I removed the
<mvt:item name="cattree" /> and replaced it with
<mvt:foreach iterator="tree" array="cattree">
<mvt:if expr="l.settings:tree:code NE 'Business'">
<mvt:if expr="l.settings:tree:image">
&mvt:tree:pad;<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code; " class="&mvt:tree:class;"><img src="&mvt:tree:image;" border="0" alt="&mvt:tree:name;"></a><br>
<mvt:else>
&mvt:tree:pad;<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code;" class="&mvt:tree:class;">&mvt:tree:name;</a><br>
</mvt:if>

</mvt:if>
</mvt:foreach>

I got nothing - no tree was displayed at all.

sebenza
01-11-07, 05:00 PM
Is the cattree item still activated for that page under the Items tab?

leslienord
01-11-07, 05:36 PM
Yes, it is.

peteru6@msn.com
02-23-07, 08:28 PM
What is the resolution to this? I bought the cattree module, tried this and get no display. Please help!