Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Mark2] Create function to return a preset height

Quote Reply
Re: [Mark2] Create function to return a preset height In reply to
Hi,

Do you really need a function?

In include_header.html, do something like:

Code:
<%if home_flag == 1%>
<%set height_of_div = "1234"%>
<%elsif login_flag == 1%>
<%set height_of_div = "1100"%>
<%elsif search_flag == 1%>
<%set height_of_div = "900"%>
<%else%>
<%-- default height, where no "flags" are set --%>
<%set height_of_div = "1000"%>
<%endif%>

..and just add as many "flags" as you want (obviously you need to "set" these flags in the templates, i.e in search.html / search_results.html, you would do: <%set search_flag = "1"%>)

Then, whereever you wanna use that "height", you would simply call it with:

<%height_of_div%> (be sure to remove the global too, otherwise it will stop that variable working Smile)

Hope that hepls

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!
Subject Author Views Date
Thread Create function to return a preset height Mark2 3560 Nov 16, 2010, 11:18 AM
Thread Re: [Mark2] Create function to return a preset height
Andy 3442 Nov 16, 2010, 11:26 AM
Post Re: [Andy] Create function to return a preset height
Mark2 3436 Nov 16, 2010, 12:11 PM