Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Pass a variable to home.html in the URL?

Quote Reply
Pass a variable to home.html in the URL?
Can I pass a variable to my Links SQL home page template (home.html) via the URL? Eg, if someone goes to www.mysite.com?name=fred, I want my home page to display Hello Fred.

I've tried setting a global called name which does sub {return param('name')}, and then referring to a <%name%> within my template, but I get a compile error when trying to do a full build.

Anyone know how to do this? I've had a request to customise my site via this method and would like to get it working.

Rob
Quote Reply
Re: [RobSchifreen] Pass a variable to home.html in the URL? In reply to
You can use any extra tags. The Template parser picks then up intelligently, and lets you use them. I.e if I use;

page.cgi?d=1&name=someone&age=15&country=UK

... I would then have access to all the normal tags, as well as;

<%UK%>
<%age%>
<%name%>
<%d%>.

Hope that makes sense :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!