How to add an input to a control

Asked on August 17, 2015 in Development.
Answered

Hi There,
I’m an aspiring developer – really love Layers and there are a few functions that I’d like to try and add in myself by creating a custom extension.

The 2 functions that I want to try and add in are:
1) Font Awesome drop-down list of icons for the “Content” widget
2) Full screen content section (similar to the full screen option for the slider widget)

I’m not asking for the answer here, but just a starting place. I have created a blank plugin, do you think you could tell me how I’d go about adding something simple like a text input to the content widget, just above the text input that says “Section Title”.

From there I should be able to figure the rest out,
Thanks a lot,
Sam

Sam Skirrow Power User
Reply
  • Possible Answers to Your Question:

  • 1 Answer(s)
    Answered on August 24, 2015. Best answer

    Hi there,
    I won’t be able to walk you through these things specifically, but encourage you to go through the Plugin Author Guide in its entirety and also check the resource links throughout that explain the functions and hooks in Layers.

    To add an icon list to a custom content widget, you need to add a custom button to the column options bar (if you want it available for each column) that produces a dropdown containing your custom markup (ie a list of icons)

    For the full screen option, simply add the full screen option to the Layout control that is already in the Slider widget to your layout option of your content widget.

    Since you can’t modify the core widgets, you can start by copying the content widget and giving it a custom class, then look at the slider widget’s arrays to see where the differing options are added.

    See these:
    input()

    Custom widget controls are covered specifically at the Widget controls section of the guide here:

    https://docs.layerswp.com/plugin-creation-guide/#adding-layers-builder-widgets

    Vail Joy Layers Team
    Reply