Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

<%if xxx%> okay... but <%ifNot%> ?

Quote Reply
<%if xxx%> okay... but <%ifNot%> ?
Hi,

In my category page, there is the <%if links%> command and the like. What if I wanted to put something if there are not links? I tried <%ifNOT links%> and <%if NOTlinks%> but neither seemed to work.

Thanks!

Quote Reply
Re: <%if xxx%> okay... but <%ifNot%> ? In reply to
<%ifnot Links%>

<%endif%>



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: <%if xxx%> okay... but <%ifNot%> ? In reply to
Is there a way to use 2 or more conditions in a template?

i.e.; %ifnot x AND %ifnot y - etc.

All the best
Shaun

Quote Reply
Re: <%if xxx%> okay... but <%ifNot%> ? In reply to
AND's are easy, but OR's are tough. To do an AND:

<%ifnot x%>
<%ifnot y%>
..
<%endif%>
<%endif%>

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: <%if xxx%> okay... but <%ifNot%> ? In reply to
If you want to use OR in the tags, you will have to define unique tags in the appropriate subroutine in the HTML_Templates.pm module:

EXAMPLE: (in the sub site_html_link routine)

Code:

if (($rec->{'Fieldname'} eq 'something') OR ($rec->{'AnotherField'} eq 'somethingelse')) {
$LINKS{specialtag} = qq|HTML CODES|;
}
else {
$LINKS{specialtag} = qq|SOME OTHER HTML CODES|;
}


Then define the "specialtag" in the load_template hash:

Code:

specialtag => $specialtag


Then you can use <%specialtag%> in the link.html file.

Regards,

Eliot Lee