0

Is there anyway to output entry data from a particular field, find the separator and output HTML based on that separator?

Example:

Postcode Field for Entry Outputs: LL21, LL22, LL33, LL44, LL46

But I want to find the comma and replace with an opening and closing

So the result would be: LL21</span> <span>LL22</span> <span>LL33</span> <span>LL44</span> <span>LL46

I would hard code the first and final span.

Is it possible EE2 and EE3?

1

You can use a wonderful EE utility called Streeng to do this (and lots of other things).

Streeng performs a broad variety of manipulations on the tag outputs, including stripping out some or all of the <html> tags within it, and performing substitutions. You could use these features to achieve what you are describing.

With Streeng installed, to get a version of the tag output with , replaced by </span><span> you would need to enclose the tag as follows:

{exp:streeng find="," replace="</span><span>"} {your_tag_goes_here} {/exp:streeng}

HTH

1
  • Thank you for that! Just seen that available for ee3 too! Amazing! – Third_Hyperion Oct 18 '17 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.