Hi,
I'm developing a website for a DJ-Booking agency, which amongst other stuff contains profiles for the DJs (a cloneable template called artists.php) and a booking form. I'm calling this template in the form, so each artist is represented as a checkbox:
That works, but it's not enough
.
The artists.php-template contains an editable called artist_profile_pic. I want to use the profile pic to replace the html-checkboxes with some neater looking solution (with CSS & jQuery).
Is there any way I could attach this variable (and others) to the corresponding label or input as a data-attribute, so the output looks something like this:
?
I guess what I'm asking makes no sense, since the pages tag is called inside the opt_values parameter and there's no way to push a variable outside of the pages tag ?
Alternatively, I tried to wrap the pages tag around the cms:input like this:
This resulted in the correct amount of checkboxes, but all were filled with k_page_title and artist_profile_pic of the most recently added artist. Any ideas what I'm doing wrong here?
Thanks in advance
I'm developing a website for a DJ-Booking agency, which amongst other stuff contains profiles for the DJs (a cloneable template called artists.php) and a booking form. I'm calling this template in the form, so each artist is represented as a checkbox:
- Code: Select all
<cms:input type="checkbox" name="artist" opt_values="
<cms:pages masterpage='artists.php'>
<cms:show k_page_title /> | </cms:pages>
"
/>
That works, but it's not enough

The artists.php-template contains an editable called artist_profile_pic. I want to use the profile pic to replace the html-checkboxes with some neater looking solution (with CSS & jQuery).
Is there any way I could attach this variable (and others) to the corresponding label or input as a data-attribute, so the output looks something like this:
- Code: Select all
<label for="artist0">
<input id="artist0" type="checkbox" value="The Beatles" name="artist[]" data-profile-pic="images/beatles.jpg" />
The Beatles
</label>
<label for="artist1">
<input id="artist1" type="checkbox" value="Rolling Stones" name="artist[]" data-profile-pic="images/stones.jpg" />
Rolling Stones
</label>
<!-- et cetera -->
?
I guess what I'm asking makes no sense, since the pages tag is called inside the opt_values parameter and there's no way to push a variable outside of the pages tag ?
Alternatively, I tried to wrap the pages tag around the cms:input like this:
- Code: Select all
<cms:pages masterpage='artists.php'>
<cms:input type="checkbox" name="art" opt_values=" <cms:show k_page_title /> " data-profile-pic="<cms:show artist_profile_pic />" /> </cms:pages>
This resulted in the correct amount of checkboxes, but all were filled with k_page_title and artist_profile_pic of the most recently added artist. Any ideas what I'm doing wrong here?
Thanks in advance