Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: smd_each: iterate over stuff
johnstephens wrote:
Setting
delim
,outdelim
, orparadelim
to|
doesn’t help
Unfortunately no, cf. the comment above to the blue dragon. The plugin is pretty stupid and it really needs a make-over. If you solve the order thing and need the plugin for your site, let me know and I’ll divert some time to it.
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: smd_each: iterate over stuff
johnstephens wrote
However, the required subset=“2” setting only takes commas as a delimiter. Is that right?
In my experience, subset="2"
always required colon (:
) as separator, when using type="fixed"
(don’t recall trying with other types).
For example:
<txp:smd_each type="fixed" include="my_categories:music:film:games:arts:literature" subset="2">...</txp:smd_each>
where my_categories
is just the variable name and music
, film
, games
, etc, are each of the values smd_each iterates over.
It always looked a bit odd to me to use the same separator (the colon) between the variable name and the list of values, and between the values themselves. Not complaining, just an observation!
Offline
Re: smd_each: iterate over stuff
Smd Each Challenge I can’t quite get sorted.
I have two variables which are each lists (prices and sizes).
- prices=”$3,$8,$2,$6”
- sizes=“glass,pitcher,glass(happy hour)|pitcher(happy hour)”
I want to output this:
<p>$3 bottle | $8 pitcher</p>
<p>$2 bottle(happy hour) | $6 pitcher(happy hour)</p>
What I really need to do is make a new variable which is an alternating list of prices and sizes. Any ideas?
Offline