Layouts Plugin

Note to users of this plugin (@Pad_Pors) . I’ve changed the way widgets are enabled and positioned. Rather than listing widgets in settings, you now select the position and whether the widget is pinned in a separate admin panel.

Instead of monkey patching the SiteSetting model, i.e.

SiteSetting.class_eval do
  @choices[:layouts_sidebar_left_widgets].push('profile')
end

You now add widgets in your plugin.rb like so:

DiscourseLayouts::WidgetHelper.add_widget('election-list')

This will make them appear on the list of widgets in the new admin panel.

2 Likes