Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  Steve 2 months, 2 weeks ago.

  • Author
    Posts
  • #9288

    nuralamsiddikashik
    Participant

    I’m so happy using the piklist But sadly, there is no icon picker field in the piklist. I read the entire documentation. How to get an icon picker or icon Picker will be released in next piklist released ?.

    Thanks
    Nur Alam Siddik Ashik

  • #9289

    Steve
    Keymaster

    @nuralamsiddikashik– Piklist can probably build this for you. Can you provide an example of an Icon Picker field you like?

  • #9290

    nuralamsiddikashik
    Participant

    piklist(‘field’, array(
    ‘type’ => ‘icon_picker’
    ,’field’ => ‘demo_icon_picker’
    ,’label’ => ‘Icon Picker’
    ,’attributes’ => array(
    ‘class’ => ‘text’
    )
    ));

    Attachments:
    You must be logged in to view attached files.
  • #9292

    nuralamsiddikashik
    Participant

    @Steve any answer

  • #9293

    Steve
    Keymaster

    @nuralamsiddikashik– this is doable with Piklist. That field is essentially a radio field, but you select images instead of text.

    You probably want your field to look something like this:

      piklist('field', array(
        'type' => 'radio'
        ,'field' => 'my_icon_picker'
        ,'value' => 'first'
        ,'label' => 'Choose an icon'
        ,'list' => false
        ,'choices' => array(
          'icon_1' => '<img width="28px" src="http://my-first-image.jpg" />'
          ,'icon_2' => '<img width="28px"  src="http://my-second-image.jpg" />'
          ,'icon_3' => '<img width="28px"  src="http://my-third-image.jpg" />'
          )
      ));

    If you have an array of the icons with their urls, you can populate the choices array automatically.

    Hope this helps.

You must be logged in to reply to this topic.