Webmastersite.net
Register Log In

IF / ELSEstatement not functioning
involves custom templates, and CATADMIN

Comments on IF / ELSEstatement not functioning

sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted May 08, 2006 - 2:55 AM:

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.
sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted May 08, 2006 - 3:27 PM:

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.
sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted May 08, 2006 - 6:29 PM:

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>
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted May 08, 2006 - 8:20 PM:

Template conditionals shouldn't be used in any language, they're not supposed to work there.
sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted May 09, 2006 - 2:28 PM:

Thanks Paul.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.