I have a channel for scholarships with a a Multi Select field with a list of schools. Each scholarship is available to certain schools, so I want to create a div with a class for each school, so I can use jQuery to hide/show scholarships available for each school using select. The options are hard coded right now.

<option value="Example1-High-School">Example1 High School</option>
<option value="Example2-High-School">Example2 High School</option>

What I am getting

<div class="Example1 High School Example2 High School">
 More information about the scholarship

What I want

<div class="Example1-High-School Example2-High-School">
 More information about the scholarship

Here is my template code:

            {exp:channel:entries channel="scholarships" dynamic="off" sort="asc" orderby="title"}
            <div class="{schools}{exp:low_replace find='SPACE' replace='-'}{item}{/exp:low_replace} {/schools}">
{/schools}      </ul>

How about something like this:

class="{exp:low_replace find="SPACE|," replace="-|SPACE" multiple="yes"}{schools backspace="1"}{item},{/schools}{/exp:low_replace}"

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.