Using the directions provided in the manual and in the support forum, I have created two types of categories.
Category X uses a custom edit and suggest category templates.
Category Y uses the default edit and suggest category templates.
When creating a new category the first question is:
Which type of category is this? X or Y (radio button) X=0 and Y=1
My goal was to create an if then statement such that, when the category is type X then the editor sees the message "Edit X Type Category" and that links to the custom edit template.
If the category is type Y, then the editor sees the default edit.gif message which links to the default template.
Basically, Category X uses only 3 of the fields that Category Y uses...I want it easier on the eye so editors (or moderators) don't need to see extraneous fields that don't apply.
Here is my language so far that I've place in the language section that equals {CATADMIN}
<IF {CATTYPE} is 0><a href="edit.php?custom=yes&TID=custom-editX&action=category&field=id&condition=equals&fieldvalue={CATID}">Edit X Type Category</a> <OTHERWISE IF {CATTYPE} is 1><a href="{PATH}"><img src="templates/default/images/edit.gif" border="0" alt="edit"></a></OTHERWISE></IF>
Currently all this does is show the "Edit X Type Category" Link and not the Edit.gif image alternate default link.
I've messed around for hours with different alterations, and the closest I ever got was seeing both links and I don't want to see both, just one or the other.
The links for the custom suggest and edit templates work BTW.
Thanks for any help. I hope that information was substantial enough.
I figured out a work around. Putting the IF statement in the language section was making it not function.
I placed the IF statement directly on the main.tpl (and everywhere else {CATADMIN} appears) like this:
<IF {CATTYPE} is x><a href="edit.php?custom=yes&TID=custom-editx&action=category&field=id&condition=equals&fieldvalue={CATID}">Edit X Category</a><OTHERWISE>{CATADMIN}</IF>
Comments on IF / ELSEstatement not functioning
Forum Regular
Usergroup: Customer
Joined: Nov 25, 2003
Total Topics: 70
Total Comments: 211
Using the directions provided in the manual and in the support forum, I have created two types of categories.
Category X uses a custom edit and suggest category templates.
Category Y uses the default edit and suggest category templates.
When creating a new category the first question is:
Which type of category is this? X or Y (radio button) X=0 and Y=1
My goal was to create an if then statement such that, when the category is type X then the editor sees the message "Edit X Type Category" and that links to the custom edit template.
If the category is type Y, then the editor sees the default edit.gif message which links to the default template.
Basically, Category X uses only 3 of the fields that Category Y uses...I want it easier on the eye so editors (or moderators) don't need to see extraneous fields that don't apply.
Here is my language so far that I've place in the language section that equals {CATADMIN}
<IF {CATTYPE} is 0><a href="edit.php?custom=yes&TID=custom-editX&action=category&field=id&condition=equals&fieldvalue={CATID}">Edit X Type Category</a> <OTHERWISE IF {CATTYPE} is 1><a href="{PATH}"><img src="templates/default/images/edit.gif" border="0" alt="edit"></a></OTHERWISE></IF>
Currently all this does is show the "Edit X Type Category" Link and not the Edit.gif image alternate default link.
I've messed around for hours with different alterations, and the closest I ever got was seeing both links and I don't want to see both, just one or the other.
The links for the custom suggest and edit templates work BTW.
Thanks for any help. I hope that information was substantial enough.
Forum Regular
Usergroup: Customer
Joined: Nov 25, 2003
Total Topics: 70
Total Comments: 211
Nope. Sorry, Damon, that didn't work. But I thank you for trying. I think it's written perfectly, it must be something else that's affecting it.
Forum Regular
Usergroup: Customer
Joined: Nov 25, 2003
Total Topics: 70
Total Comments: 211
I figured out a work around. Putting the IF statement in the language section was making it not function.
I placed the IF statement directly on the main.tpl (and everywhere else {CATADMIN} appears) like this:
<IF {CATTYPE} is x><a href="edit.php?custom=yes&TID=custom-editx&action=category&field=id&condition=equals&fieldvalue={CATID}">Edit X Category</a><OTHERWISE>{CATADMIN}</IF>
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Template conditionals shouldn't be used in any language, they're not supposed to work there.
Forum Regular
Usergroup: Customer
Joined: Nov 25, 2003
Total Topics: 70
Total Comments: 211
Thanks Paul.