0

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.

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

What I am getting

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

What I want

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

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}">
                <h2>{title}</h2>
                <h3>Schools:</h3>
                <ul>{schools}
                    <li>{item}</li>
{/schools}      </ul>
                {description}
            </div>
            {/exp:channel:entries}
0

How about something like this:

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

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.