I've got a variable that outputs a string such as:
question ^ answer > question ^ answer > question ^ answer
Now, I added the symbols in between them to know where the split should happen. I've been using the 'Explode' plugin (http://devot-ee.com/add-ons/explode) and this works perfectly. BUT it only works to split based on one set of characters e.g. ^ only.
{variable} = question 1 ^ answer 1 > question 2 ^ answer 2
{exp:explode separator=">" string="{variable}"}
<div id="question">
{exp_value}
</div>
{/exp:explode}
The above code would output:
<div id="question">
question 1 ^ answer 1
</div>
<div id="question">
question 2 ^ answer 3
</div>
Which is great, but I need my markup to be like this:
<div id="question">
question 1
</div>
<div id="answer">
answer 1
</div>
Which would require doing something like:
{variable} = question 1 ^ answer 1 > question 2 ^ answer 2
{exp:explode separator="^|>" string="{variable}"}
<div id="question">
{exp_value_1}
</div>
<div id="answer">
{exp_value_2}
</div>
{/exp:explode}
Which would then output:
<div id="question">
question 1
</div>
<div id="answer">
answer 1
</div>
<div id="question">
question 2
</div>
<div id="answer">
answer2
</div>
Now the Explode plugin comes with the {exp_value_1}
and {exp_value_2}
variables, but they don't work on a 'Loop'
Is there any way of achieving this? With any other plugin? Or another solution