Jump to content

label format for option fieldtype


regesh
 Share

Recommended Posts

I have option fieldtype with 4 elements. Many pages has this field type. On another page i want to be able to select items from pages where this option fieldtype presents using asm select. And it would be easier that when i need to select page i'll see not only {title} but better {title}-{option.title}. So here what i got: Manager name - <ul><li>option selected</li></ul>.

That's no got. And the question as i see is how to remove any html tag from cutom output label format for option fieldtype.

Thanks a lot.

Here is screenshots to better understand

post-3359-0-66632900-1444761217_thumb.pn

post-3359-0-90321500-1444761218_thumb.pn

Link to comment
Share on other sites

The standard behavior to display multi-select fields as markup is a list, even if it just has a single value. If you want to change it you can hook into Inputfield::markupValue and change this behavior on a per field basis, but keep in mind, that this will also change the markup for example when using a lister. 

Link to comment
Share on other sites

  • 4 months later...

this is presenting a major hassle for me, i have 2 places now where this markup appears in selects, one in admin and one on a formbuilder form, and i can't launch this site till i can fix it.

any idea on how to hook and fix?

been trying various things with no luck; tried hooking into FieldtypeMulti, FieldtypePage, Fieldtype, can't get the hook to fire or strip those tags

EDIT:

while it would still be good to have a fix for PW 2.7 branch for displaying these, i have found a solution described here:

https://processwire.com/talk/topic/12045-page-select-subfield-display-issue/?p=115674

Link to comment
Share on other sites

been playing with Selectize.js for complex single selects; in combination with a module that lets you take various fields from the page you are selecting and put those into a json array as a data-data attribute...

the selected option:

post-136-0-39447500-1457814407_thumb.jpg

open with search:

post-136-0-63759400-1457814408_thumb.jpg

sort of a supercharged chosen select ..

might be worth having selectize.js into an alternate to chosen select, and bundled with the ability to define the array for json data att

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...