Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
strip line breaks from beginning of form outputs
Hello
I’m feeding parameters to a Flash mp3 player and I’m running into problems because the 2nd time (and subsequent times) a form is called it prepends a line break which chokes the Flash movie.
In this example, there are 3 files attached to an article, all of which which I want to feed to the player.
In my article form I’m using two different file forms (files_name and files_description) which loop through the file IDs to output the file-names first, then the corresponding file descriptions (as required by the Flash player).
<param name="FlashVars" value="mp3=<txp:upm_article_file_list form="files_name" />&title=<txp:upm_article_file_list form="files_description" />&height=70&width=282"/>
There are no spaces or breaks in the two file forms – they contain only the relevent <txp:file_download_ />
tags. But in the output, where I need this:
<param name="FlashVars" value="mp3=legs.mp3|arms.mp3|hands.mp3|&title=Legs|Arms|Hands|&height=70&width=282 "/>
I’m getting this instead:
<param name="FlashVars" value="mp3=legs.mp3|
arms.mp3|
hands.mp3|&title=Legs|
Arms|
Hands|&height=70&width=282 "/>
And the player doesn’t like that. I find it strange that if there’s only one file to iterate over then no line break is generated – it only happens after first time each form is called.
The options I can see are:- trim the
\n
s with php trim – which I’ve tried with no success (due to paltry php skills) - point the Flash movie to some XML – which it is also built to handle, but which I initially presumed would be the more complicated option
- find a plugin / hack to strip the breaks
all suggestions gratefully received…
Stu
Offline
Re: strip line breaks from beginning of form outputs
Has upm_article_file_list
got a break
attribute? It might be set to <br />
by default.
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
Re: strip line breaks from beginning of form outputs
It does, it is, and I hadn’t defined it, so you’d expect it to output a <br />
But in fact it doesn’t output any html element between outputs. I tried to set break=""
to be sure but that didn’t affect anything.
To be clear, there isn’t any code getting in the way, just pesky line breaks. Does that make sense?
Offline