Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-08-07 09:21:39

phual
Member
From: UK
Registered: 2008-02-19
Posts: 26
Website

Passing variables to forms

I’ve been given a new requirement for html-streaming audio. There are plugins available to help with this, but are really for more complex problems than mine and lack style flexibility without editing the plugin code itself. I found myself wondering how I could pass a variable to be called within a form, so that I can define my ‘static variables’ within a form (e.g. style and options of a flash audio-player) and then call it with a simple <txp:output_form form="formname" /> plus the file path / whatever variable.

If there is a solution to this, then it has the potential to be extremely useful, as a webmaster could decide what software / script / whatever to use without being constricted to utilising or creating a plugin specific to the issue. It also allows multiple variations on the same code, which is not possible with many plugins (e.g. you want the style of a player to be different dependent upon different factors).

Thoughts?

Stuart

Offline

#2 2010-08-07 11:06:37

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,942
Website GitHub

Re: Passing variables to forms

phual wrote:

pass a variable to be called within a form

Can <txp:yield /> help?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2010-08-10 12:20:45

phual
Member
From: UK
Registered: 2008-02-19
Posts: 26
Website

Re: Passing variables to forms

Ooh… that’s a nice little addition for 4.2.0. Not quite all I was hoping for but 9/10ths of the way there.

Thanks

Stuart

Offline

Board footer

Powered by FluxBB