Gossamer Forum
Quote Reply
Global request
Hi

is there a global or a way that I can use :

<%if URL ends with img or gif%>

something

<%endif%>
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Global request In reply to
I think the closest you could get is:

Code:
<%if URL contains 'img' or URL contains 'gif'%>

something

<%endif%>

I'm not 100% that will work. You could use a global if you wanted.

Code:
sub {
my $url = shift;
my $flag = 0;
if (index($url, 'img') > -1 or index($url, 'gif') > -1) {
$flag++;
}
return { img_flag => $flag };
}

Then if your template you'd use:

<%myglobal($URL)%>

<%if img_flag%>
Image
<%else%>
Not
<%endif%>

Hope that helps a little.

Last edited by:

PerlPod: Aug 21, 2002, 5:10 AM