Gossamer Forum
Quote Reply
Minitemplates
Perhaps "minitemplates" is a bad name, but what I am looking for advise on is a simple way to get conditional (in a RESTian sense, I think they call it) content/pages.
What?
Is there somehow I can add a field in my database that allows me to call the values in an URL?
For links, yes. But what about the global site (like &t=simple for the simple templates) ??

Example:
Fieldname: Color
Values: Red, Green, etc
Now, when calling ../page.cgi?Color=Green, the produced page would be instructed to fetch a green style (by calling <%Color eq 'Green'%>.css or whatever)

Any suggestions?

John
Quote Reply
Re: [gotze] Minitemplates In reply to
If I'm interpreting your post correctly, then you should be able to do this already. Just put:
<%if Color%><link type="text/css" rel="stylesheet" media="screen" href="<%Color%>.css" /><%endif%>

and then you'll need it to keep passing Color=Green around, so the Setup => Build Options => dynamic_preserve should do that for you.

Adrian
Quote Reply
Re: [brewt] Minitemplates In reply to
<del>Thanks for trying to understand my issue. I understand your solution, but does not understand how to implement it ... </del>

<del>Where do I put the Color field? It's as mentioned a "global" tag I want, not related to Links or Categories.
(Does LSQL react to things in the URL-string automatically? I suppose not ..)</del>

<del>Hmm. Maybe I can put it in the User base? </del>

COOL!! Cool
It does work just by adding it to the URL.
John

Last edited by:

gotze: Jan 21, 2005, 12:05 PM
Quote Reply
Re: [gotze] Minitemplates In reply to
In case anyone wonders what the heck this is all about, check out GotzeTagged (was GotzeLinked). I am here using Ivan's "suggest" idea and my extensions (used in the three buttons above the search bar).

I needed an easy way to swap between the three suggest types I offer. I ended up using stuff like:

Code:
<input type="text" id="<%if Suggest%><%Suggest%><%endif%>search" name="query" onkeypress="liveSearchStart()" size="45" />
<div id="LS<%if Suggest%><%Suggest%><%endif%>Result" style="display: none;">
<div id="LS<%if Suggest%><%Suggest%><%endif%>Shadow"></div></div>
in my templates, and call URLs like http://.../page.cgi?d=1&Suggest=livecategory.

I realise my example here might be cryptic, but it does exactly what I want it to do in my specific context Crazy -- but the principle seems to be applicable in many other contexts.

Thanks again Adrian.

John