I am trying to make a make it so that I can display banners based on the category name. It works fine except for the ones that have the word "and" in them. Here is an example of the code. Code in green will call fine, code in red will default to the <%else%> statement:
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation.com">
<%elseif $title eq 'Category: One and Two'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation1.com">
<%elseif $title eq 'Category: Three'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation2.com">
<%if $title eq 'Category Two and Three'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation3.com">
<%if $title eq 'Category Four'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation4.com">
<%elseif $title eq 'Category Four: One'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation5.com">
<%elseif $title eq 'Category Four: Two and Three'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation6.com">
<%if $title eq 'Category Five'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation7.com">
<%else%>
<%title%>
<%endif%>
How can I make this call the code if they have the word "and" in them instead of reverting to the <%else%> statement. I am entering in the ' ' exactly as it displays when called from <%title%>, so I don't know of any other way to do this. Somebody PLEASE help me! I am going nuts with this!!!
Code:
<%if $title eq 'Category'%> <a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation.com">
<%elseif $title eq 'Category: One and Two'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation1.com">
<%elseif $title eq 'Category: Three'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation2.com">
<%if $title eq 'Category Two and Three'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation3.com">
<%if $title eq 'Category Four'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation4.com">
<%elseif $title eq 'Category Four: One'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation5.com">
<%elseif $title eq 'Category Four: Two and Three'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation6.com">
<%if $title eq 'Category Five'%>
<a href="http://www.htmllinktobanner.com"><img src="http://www.bannerlocation7.com">
<%else%>
<%title%>
<%endif%>
How can I make this call the code if they have the word "and" in them instead of reverting to the <%else%> statement. I am entering in the ' ' exactly as it displays when called from <%title%>, so I don't know of any other way to do this. Somebody PLEASE help me! I am going nuts with this!!!