dreamingdigital
08-12-06, 12:03 AM
I've been working on this all afternoon and I'm stuck. The module dev. - Sebenza - Scott - won't help because it's something extra. I'm tired of wasting time on this script and need some help/guidance!!!
I want to display the top 2 categories and their subcategories all the time in my cattree. Then I want the cattree to behave normally. I just want the top 2 levels open all the time. I have a parts section and a complete items section and I want their subsections open so the top two are more like separators than links, but because we can only have 1 category tree I need to do it this way.
I have Sebenza's cattree template module installed and I'm trying to tweak it. This is what I've done to it. Parent ID 9 and Parent ID 28 are the two main categories that everything is based on. There has to be a simple solution to this!! I put in the parent id numbers into the output for debugging.
<mvt:foreach iterator="tree" array="cattree">
<mvt:if expr="g.Category_Code EQ l.settings:tree:code">
<!-- if the category is the current page -->
<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;<b>></b> <a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code;" class="&mvt:tree:class;" style="font-weight:bold;">&mvt:tree:name;</a><br>
</mvt:if>
<mvt:else>
<mvt:if expr="l.settings:tree:parent_id EQ 0">
<!-- for if is the top level category -->
<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;0 <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:elseif expr="l.settings:tree:parent_id EQ 9">
<!-- for if is the top level category's child -->
<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;9 <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:elseif expr="l.settings:tree:parent_id EQ 28">
<!-- for if is the top level category's child -->
<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;28 <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:else>
<!-- for if is a subcats of top level category's child -->
<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:if>
</mvt:foreach>
Here is a link to see the code in action. It does what I tell it to do. But not what I want the overall effect to do. I most likely don't understand how the cattree gets looped and written.
http://miva.rctoys.com/Merchant2/merchant.mvc?Screen=SFNT
Click on the cattree links. The store has nothing in it but categories so far.
PLEASE help.
I want to display the top 2 categories and their subcategories all the time in my cattree. Then I want the cattree to behave normally. I just want the top 2 levels open all the time. I have a parts section and a complete items section and I want their subsections open so the top two are more like separators than links, but because we can only have 1 category tree I need to do it this way.
I have Sebenza's cattree template module installed and I'm trying to tweak it. This is what I've done to it. Parent ID 9 and Parent ID 28 are the two main categories that everything is based on. There has to be a simple solution to this!! I put in the parent id numbers into the output for debugging.
<mvt:foreach iterator="tree" array="cattree">
<mvt:if expr="g.Category_Code EQ l.settings:tree:code">
<!-- if the category is the current page -->
<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;<b>></b> <a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:tree:code;" class="&mvt:tree:class;" style="font-weight:bold;">&mvt:tree:name;</a><br>
</mvt:if>
<mvt:else>
<mvt:if expr="l.settings:tree:parent_id EQ 0">
<!-- for if is the top level category -->
<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;0 <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:elseif expr="l.settings:tree:parent_id EQ 9">
<!-- for if is the top level category's child -->
<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;9 <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:elseif expr="l.settings:tree:parent_id EQ 28">
<!-- for if is the top level category's child -->
<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;28 <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:else>
<!-- for if is a subcats of top level category's child -->
<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:if>
</mvt:foreach>
Here is a link to see the code in action. It does what I tell it to do. But not what I want the overall effect to do. I most likely don't understand how the cattree gets looped and written.
http://miva.rctoys.com/Merchant2/merchant.mvc?Screen=SFNT
Click on the cattree links. The store has nothing in it but categories so far.
PLEASE help.