EllisLab text mark
Advanced Search
     
How to display checkbox field contents in UL list
Posted: 07 August 2012 04:55 PM   [ Ignore ]
Joined: 2003-12-15
131 posts

Hi have a custom checkbox channel field with 9 line items. Channel entries may have selected anywhere from 1 to all 9 checkboxes.

I would like to have the checked items displayed on the page in an unordered bulleted list. I have tried putting the [field_name] between ul tags, between ul/li tags with default formatting set to none, auto br, and xhtml.  But it appears that this field type automatically adds a comma after each line item. If I add li tags to each line in the field’s multi-select options, I get the bullets, but I also get an extra line break with a comma between bullet lines.

Any suggestions for how to get a bulleted list to display.

Worst case, I can go to a text area and define the list with tags, but that will make entries a slower.

Maybe it would need a custom field type defined.

 Signature 

EE 2.3.1 user. Discussion Forum 3.1.2 user.

 
Posted: 08 August 2012 01:31 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hello Stoelting,

I am sorry to hear you are running into this problem.

Can you show me how you are calling this checkbox in SafeCracker?

Thank you,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 08 August 2012 09:15 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2003-12-15
131 posts

I found the answer in the EE Docs under Module > Channel Module > Channel Fields > Checkbox Fields.

A “Markup Parameter” can be added to a checkbox field tag to identify it as an unordered or ordered list. The single field tag would look like this:

{checkbox_field_name markup="ul"

The selected items then appear in a standard bulleted html list, without the commas. CSS styles can then be applied for the “ul” and “li” tags.

 Signature 

EE 2.3.1 user. Discussion Forum 3.1.2 user.

 
Posted: 09 August 2012 01:04 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey Stoelting,

That’s awesome! Nice work.

Is there anything else I can help with?

Thank you,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 09 August 2012 01:16 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2003-12-15
131 posts

That’s all for this topic. I’m brewing some other questions for later.grin

 Signature 

EE 2.3.1 user. Discussion Forum 3.1.2 user.

 
Posted: 09 August 2012 01:22 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hey Stoelting,

Awesome! grin

If you need anything else, please just let me know by opening a new thread.

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade