Feature Request: Separate Body widgets to sidebar widgets

Asked on December 15, 2015 in Feature Requests.

Hi There,

I love using layers at the minute, one of the things that I think is the only non-intuitive thing is the list of available widgets. It would be great if you could find a way to separate out widgets intended for use in the body (i.e. content, contact & maps, posts etc) from those intended for sidebars.

Is that possible?

Sam Skirrow Power User
1 Answer(s)
Answered on December 15, 2015.

Hi there,
All Layers Widgets are for use in Layers pages specifically (ie not sidebars) and we indicate them via the Layers icon (all extensions should also be doing this). While some of them can certainly be added and customized to work in a sidebar-sized widget area, that is not the intent. The actual widget list in the Customizer is a function of WordPress, so we can’t really change what you can see there based on what you are editing.

Hi there,
Not sure if this is of any use to you, I actually managed to solve this issue today. This piece of code I wrote separates out widgets that are for use in layers pages, when editing a layers page, and vice versa.

For example, now when you click on [your-page] Body, you will only see layers widgets, similarly, if you click on “Mobile Sidebar”, or “Footer 1” etc – you will only see widgets for sidebars.

Let me know what you think.

 jQuery(document).ready(function($) {
    $("ul.accordion-section-content li[id*='layers-builder'] button.add-new-widget").click(function() {
        $("#available-widgets-list > div:not([id*='layers-widget'])").toggle();
    $("ul.accordion-section-content li:not([id*='layers-builder']) button.add-new-widget").click(function() {
        $("#available-widgets-list > div[id*='layers-widget']").toggle();
on January 11, 2016.