Presenting boolean values in the table/list.
Created 7 years ago by williamLets say i have a field in my module which is an boolean. I want to show the value in the table/list. Then it only shows 1 or nothing. Is there any possibility to manipulate the output? What i really am looking to do is a nice presenter, maybe a red NO button if 0, otherwise a nice green button YES. But its fine if i can at least have it say YES or NO.
Check out the presenter and in particular the label method: http://pyrocms.com/documentation/boolean-field-type/v2.1#usage/presenter-output/booleanfieldtypepresenter-label
You can get this in your tables like
entry.field_slug.label
. Which is just shorthand forentry.field_slug.label()
.The
toggle
method is a nifty one too.