Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
AM2 - templateIF magic in categoryMenu.html

 

 


HDBC
User

Nov 16, 2006, 9:19 PM

Post #1 of 7 (1347 views)
Shortcut
AM2 - templateIF magic in categoryMenu.html Can't Post

Ok, I'm stuck :)

Just when I think I've got it, by George, everything disappeared.

I'm trying to use an alternate style or table row for a category based upon it being selected or not as well as based upon its category depth (the alternate table row would allow me to put the category name/link in a table cell with an image (a pointer) in another cell to it's left)

Here's the code I'm using - what's wrong with it? (this example was only trying to vary a style)


Quote


<table border="0" cellspacing="0" cellpadding="0" width="146" class="nav_left">

<!-- template insert : $categoryList$ -->
<!-- templatecell : categoryRow -->
<!-- templateIf : $category.depth$ == '1' -->
<!-- templateIf : $isSelectedCategory$ == '1' -->
<tr class="selected_category">
<td class="categoryDepth$category.depth$"><a href="$published.categoryIndex.url$">$category.name$</a></td>
<!-- /templateIf -->
<!-- templateIf : $isSelectedCategory$ == '0' -->
<tr class="not_selected_category">
<td class="categoryDepth$category.depth$"><a href="$published.categoryIndex.url$">$category.name$</a></td>
<!-- /templateIf -->
<!-- /templateIf -->

<!-- templateIf : $category.depth$ == '2' -->
<!-- templateIf : $isSelectedCategory$ == '1' -->
<tr class="selected_category">
<td class="categoryDepth$category.depth$"><a href="$published.categoryIndex.url$">$category.name$</a></td>
<!-- /templateIf -->
<!-- templateIf : $isSelectedCategory$ == '0' -->
<tr class="not_selected_category">
<td class="categoryDepth$category.depth$"><a href="$published.categoryIndex.url$">$category.name$</a></td>
<!-- /templateIf -->
<!-- /templateIf -->
</tr>
<!-- /templatecell : categoryRow -->
<!-- templateIf : $categoryList$ eq "" -->
<tr>
<td>No categories found.</td>
</tr>
<!-- /templateIf -->
<tr>
<td valign="middle" style="padding-top:10px;padding-left:10px;padding-bottom:10px;"></td>
</tr>
</table>



Thanks for the help!!

Eric


Damon
Staff / Moderator


Nov 18, 2006, 10:29 AM

Post #2 of 7 (1324 views)
Shortcut
Re: [HDBC] AM2 - templateIF magic in categoryMenu.html [In reply to] Can't Post

Hi Eric,

Give this code a try:

<table border="0" cellspacing="0" cellpadding=5 width="100%" class="nav_left_header">
<tr>
<td><a href="$published.globalIndex.url$">$my.homepageName$</a></td>
</tr>
</table>

<table border="0" cellspacing="0" cellpadding="0" width="100%" class="nav_left">
<!-- template insert : $categoryList$ -->

<!-- templatecell : categoryRow -->
<tr[templateIf : $isSelectedCategory$ == '1'] class="selected_category"[/templateIf]>
<td width="40px">
<!-- templateIf : $isSelectedCategory$ == "0" -->
&nbsp;
<!-- /templateIf -->

<!-- templateIf : $isSelectedCategory$ == "1" -->
<!-- templateIf : $category.depth$ == "1" -->
<img src="http://www.interactivetools.com/forum/images/smile.gif">
<!-- /templateIf -->
<!-- templateIf : $category.depth$ == "2" -->

<img src="http://www.interactivetools.com/forum/images/smile.gif">
<img src="http://www.interactivetools.com/forum/images/smile.gif">
<!-- /templateIf -->
<!-- /templateIf -->


</td>
<td class="categoryDepth$category.depth$">
<a href="$published.categoryIndex.url$">$category.name$</a>
</td>
</tr>

<!-- /templatecell : categoryRow -->

<!-- templateIf : $categoryList$ eq "" -->
<tr><td>No categories found.</td></tr>
<!-- /templateIf -->

<tr>
<td>&nbsp;</td>
<td>
<a href="$published.globalRSS.webpath$">
<img src="$_weburl$images/webfeed.gif" width="16" height="16" border="0" align="left"></a>
<div class="webfeed"><a href="$published.globalRSS.webpath$">News Feed</a></div>
</td>
</tr>
</table>

I used Smile images to demo how to selected categories would look.

Hope that is what you had in mind. Let us know if you have any other questions.

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/


HDBC
User

Nov 19, 2006, 5:38 PM

Post #3 of 7 (1304 views)
Shortcut
Re: [Damon] AM2 - templateIF magic in categoryMenu.html [In reply to] Can't Post

Hey Damon,

This doesn't seem to work... are you sure the code is right? We seem to have a couple of smiley faces in a row...

Eric


Damon
Staff / Moderator


Nov 20, 2006, 10:10 AM

Post #4 of 7 (1290 views)
Shortcut
Re: [HDBC] AM2 - templateIF magic in categoryMenu.html [In reply to] Can't Post

Hi Eric,

It may be quite possible that I misunderstood the results you were after. :)

What the code I included does is add one image to left of a selected category if the category is 2 deep and two images if the selected category is three deep.

The images were just examples and can be replaced with another image, a class, etc.

Do you have an example site or image of the navigation that you have in mind?

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

(This post was edited by Damon on Nov 20, 2006, 10:10 AM)


HDBC
User

Nov 20, 2006, 11:17 AM

Post #5 of 7 (1283 views)
Shortcut
Re: [Damon] AM2 - templateIF magic in categoryMenu.html [In reply to] Can't Post

Hi Damon,

I'm trying to recreate the menu structure I was able to make using AM1..

http://www.seattlecouncilptsa.org/index.shtml

Thanks for your suggestions!


Damon
Staff / Moderator


Nov 22, 2006, 8:07 AM

Post #6 of 7 (1262 views)
Shortcut
Re: [HDBC] AM2 - templateIF magic in categoryMenu.html [In reply to] Can't Post

Hi Eric,

Thanks for the example link, that helped. :)

Try this (categoryMenu.html) code:

<table border="0" cellspacing="0" cellpadding=5 width="100%" class="nav_left_header">
<tr>
<td><a href="$published.globalIndex.url$">$my.homepageName$</a></td>
</tr>
</table>


<table border="0" cellspacing="0" cellpadding="0" width="100%" class="nav_left">
<!-- template insert : $categoryList$ -->
<!-- templatecell : categoryRow -->


<tr[templateIf : $isSelectedCategory$ == '1'] class="selected_category"[/templateIf]>
<!-- templateIf : $isSelectedCategory$ == "0" -->
<td>&nbsp;</td>
<!-- /templateIf -->


<!-- templateIf : $isSelectedCategory$ == "1" -->
<!-- templateIf : $category.depth$ == "0" -->
<td style="background: rgb(153, 51, 51); width: 8px;">&nbsp;</td>
<!-- /templateIf -->


<!-- templateIf : $category.depth$ == "1" -->
<td style="background: rgb(153, 51, 51); width: 8px;">&nbsp;</td>
<!-- /templateIf -->


<!-- templateIf : $category.depth$ == "2" -->
<td style="background: rgb(153, 51, 51); width: 8px;">&nbsp;</td>
<!-- /templateIf -->


<!-- /templateIf -->

<td class="categoryDepth$category.depth$">
<a href="$published.categoryIndex.url$">$category.name$</a>
</td>
</tr>


<!-- /templatecell : categoryRow -->

<!-- templateIf : $categoryList$ eq "" -->
<tr><td>No categories found.</td></tr>
<!-- /templateIf -->


<tr>
<td>&nbsp;</td>
<td>
<a href="$published.globalRSS.webpath$">
<img src="$_weburl$images/webfeed.gif" width="16" height="16" border="0" align="left"></a>
<div class="webfeed"><a href="$published.globalRSS.webpath$">News Feed</a></div>
</td>
</tr>
</table>


The selected catgeory will now have a red box to the left. Just apply your styles classes to the code and that should be it.

Let me know how it works out.


--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/


HDBC
User

Nov 25, 2006, 3:27 PM

Post #7 of 7 (1227 views)
Shortcut
Re: [Damon] AM2 - templateIF magic in categoryMenu.html [In reply to] Can't Post

Hey All,

Ok - I'm mighty happy (and a wee bit embarassed) to say that I figured out the problem I was having.

The code that Daman and all have suggested works just fine. The problem was that I after I set up my globalIndex.html template, I copied much of the code and used it to speed up the creation of my categoryIndex.html templates. Unfortunately, I didn't notice that the menu include that I copied was $published.globalMenu.webpath$ rather than $published.categoryMenu.webpath$ Because of this little mistake I my category specific menus weren't being displayed, even though the proper include_categoryMenu.shtml file was being published to the respective category folders.

Whew!

Hopefully others will avoid the same mistake I made!