Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Check if Internal URL or External URL

Quote Reply
Check if Internal URL or External URL
I've setup a Go_To filed in Category DB.
I call this <%Go_To%> somewhere in the categories to direct the user to INTERNAL CATEGORY or EXTERNAL WEBSITE based on what I put as a value in the field.
Now, if I put a value 123 or 12/4/123 in the Go_To field, then the link where I call it from will go to:
<%config.build_root_url%>/<%Go_To%>/index.html .. then becomes
http://www.mydomain.com/12/4/123/index.html which is valid reference to internal category.

but, if I want the link to go to an external site (http://www.yahoo.com/) , then I specify the site URL in Go_To field... but this will cause a dead link
http://www.mydomain.com/http://www.yahoo.com/index.html

My question, what would be the Perl code that I should use inside category.html template to make this work... (I can modify the way I call the Go_To filed... but I do not like this way, then I need to put long URL in the Go_To field...)
something like ...

If the call to an internal page/category (or if it does not start with "http://www") then
<%config.build_root_url%>/<%Go_To%>/index.html
else:
<%Go_To%>
endif;

Thank you
Mark
Subject Author Views Date
Thread Check if Internal URL or External URL Mark2 4215 Sep 26, 2008, 8:10 AM
Thread Re: [Mark2] Check if Internal URL or External URL
Andy 4155 Sep 26, 2008, 8:17 AM
Thread Re: [Andy] Check if Internal URL or External URL
Mark2 4136 Sep 26, 2008, 9:20 AM
Thread Re: [Mark2] Check if Internal URL or External URL
Andy 4151 Sep 26, 2008, 9:22 AM
Thread Re: [Andy] Check if Internal URL or External URL
Mark2 4136 Sep 26, 2008, 9:52 AM
Thread Re: [Mark2] Check if Internal URL or External URL
Andy 4135 Sep 26, 2008, 10:19 AM
Thread Re: [Andy] Check if Internal URL or External URL
Mark2 4131 Sep 26, 2008, 10:33 AM
Post Re: [Mark2] Check if Internal URL or External URL
Andy 4098 Sep 27, 2008, 12:19 AM