Usergroup: Member
Joined: Mar 04, 2008
Total Topics: 5
Total Posts: 13
Posted 03/29/08 - 12:18 PM:
#1
Hi Paul,
Gotta question: I'm restricting the category listing on main.tpl to just regular category types with an IF statement. However, when I do that, WSNLinks is still adding the additional <tr> and </tr> elements for the other category types (although, there's nothing in them). Do you have any suggestions on how I could remove those? Sorry to nitpick, it's just I'm just trying to make it xhtml compliant and the validator has problems with <tr> and </tr> with nothing in it.
<table align="center" width="80%"> <!-- BEGIN CATSBODY --> <!-- BEGIN REGULAR --> <IF {CATTYPE} is regular> <td {CATWIDTH} valign="top" class="category"> <a href="{CATURL}" class="categoryname">{CATCATOTHERNAME}</a> ({CATNUMLINKS}) {CATHASNEW} {CATADMIN}<br /> <!-- BEGIN SUBSUB --> <a href="{CATURL}">{CATNAME}</a>, <!-- END SUBSUB --> <IF {SWITCH_FORUMVIEWS} or {SWITCH_ONLINEFORUM}><br /></IF> <IF {SWITCH_FORUMVIEWS}>{CATVIEWS} views</IF><IF {SWITCH_FORUMVIEWS} and {SWITCH_ONLINEFORUM}>, </IF> <IF {SWITCH_ONLINEFORUM}>{CATNUMONLINE} viewing</IF> </td> </IF> <!-- END REGULAR --> <!-- END CATSBODY --> </table>
Usergroup: Customer
Joined: Aug 19, 2005
Location: England
Total Topics: 258
Total Posts: 819
Posted 03/29/08 - 10:45 PM:
#2
I haven't used category types before, but would have presumed that you don't need an IF statement to show just regular as you only have BEGIN REGULAR there, and not BEGIN OTHERTYPE
Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 49
Total Posts: 5539
Posted 03/30/08 - 06:05 AM:
#3
You should remove the conditional.
In order to show particular category types but not others, you have to explicitly write out the section for the others and then leave it blank. This is so that people who don't know that they need to edit the template when they add a new category type don't see their categories vanishing.
If you have a category type named 'example', place
<!-- BEGIN EXAMPLE --> <!-- END EXAMPLE -->
above or below your REGULAR section, but still within the CATSBODY area in order to make the example type invisible.
Presumably you want 'mix category types' set to no in your category settings.
Usergroup: Member
Joined: Mar 04, 2008
Total Topics: 5
Total Posts: 13
Posted 03/31/08 - 09:03 AM:
#4
Hi Paul,
Yesterday, I got it to work for a quick second and looked at the html, but it still was adding the additional <tr>s.
The odd thing is it then started to kind of break afterwards. Check it out: http://www.educational-software-directory.net/wsn... . It's outputting some variables (?) onto the page, but I've checked and rechecked and rechecked and the code looks good.
<table align="center" width="80%"> <!-- BEGIN CATSBODY --> <!-- BEGIN REVIEWS --><!-- END REVIEWS --> <!-- BEGIN ORGANIZATIONS --><!-- END ORGANIZATIONS --> <!-- BEGIN PUBLICATIONS --><!-- END PUBLICATIONS --> <!-- BEGIN REGULAR --> <td {CATWIDTH} valign="top" class="category"> <a href="{CATURL}" class="categoryname">{CATNAME}</a> ({CATNUMLINKS}) {CATHASNEW} {CATADMIN}<br /> <!-- BEGIN SUBSUB --> <a href="{CATURL}">{CATNAME}< /a>, <!-- END SUBSUB --> <IF {SWITCH_FORUMVIEWS} or {SWITCH_ONLINEFORUM}><br /></IF> <IF {SWITCH_FORUMVIEWS}>{CATVIEWS} views</IF><IF {SWITCH_FORUMVIEWS} and {SWITCH_ONLINEFORUM}>, </IF> <IF {SWITCH_ONLINEFORUM}>{CATNUMONLINE} viewing</IF> </td> <!-- END REGULAR --> <!-- END CATSBODY --> </table>
I also couldn't find where to NOT mix category types. I know where the setting is to mix link types or not though. Where is it?
Usergroup: Member
Joined: Mar 04, 2008
Total Topics: 5
Total Posts: 13
Posted 04/08/08 - 10:36 AM:
#8
Got it to work! Hmm, it looks like when I exclude a category type I've created from the code it breaks and outputs the variables directly to the page. I needed to include ALL the category types I've created. (I had a category (which was also a type) that was hidden, so I thought not to include it in the list) I guess that was my mistake.