How to render fontawesome on Editor Select Field
How to render fontawesome on Editor Select Field
vincmeister
Posts: 136Questions: 36Answers: 4
in Editor
Hi Allan,
I want to create rating using fontawesome fa-star
I'm using render on php field option, but not working
Field::inst( 'kpi_tdkpidetaildata.rating1' )
->options( function () {
return array(
array( 'value' => 1, 'label' => '<i class="fa fa-star"><i/>' ),
array( 'value' => 2, 'label' => '<i class="fa fa-star"><i/><i class="fa fa-star"><i/>' ),
array( 'value' => 3, 'label' => <i class="fa fa-star"><i/><i class="fa fa-star"><i/><i class="fa fa-star"><i/>)
);
} ),
and also put
entityDecode: false
on the script
but the icon won't rendered
Please advise, thank you
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'm not familiar with PHP but it looks like you might be missing a set of single quotes around the
i
tag for option 3.Kevin
@kthorngren
sorry typo when i post here,
real code not
Does that work in a normal
select
list? I've just very quickly tried a simplei
here and it doesn't make any difference to the output.I'm not sure if you can have CSS background images for an option? Have you used that else where?
Allan
Hi Allan,
Thanks for the response. I tried something like this, but not working
Plan B, custom plugins,
it works
thank you
Danny