Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-17 10:11:14

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

pass a variable from a page to a form

In a site with many sections, I’ve templated my full html <code><head></code> data into a form called ‘head’ (!) so I don’t have to write it out the same meta/css/script info into every page template.

Now if I have a <code><script></code> that I only want to link to in the head of a particular section/page, is there a clever way to insert it into the ‘head’ form from the page template?
ie. when I call the <code><txp:output_form form=“head” />
</code> is there a way to somehow pass it a (non-article-related) variable or string – using txp tags or php?

Course, i could just write the full ‘head’ form contents into that page template and add the extra data – but I’m trying to be a smart arse ;)

Offline

#2 2006-05-17 11:19:58

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: pass a variable from a page to a form

In your head form you could try wrapping the additional script inside an if_section tag pair. Something like this…

<txp:if_section name="your_special_section"> Section specific script stuff in here. </txp:if_section>


Steve

Offline

#3 2006-05-17 11:32:22

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: pass a variable from a page to a form

that’s the bunny!
thanks Steve

Offline

Board footer

Powered by FluxBB