Installation and Setup

The installation and setup of the Layouts Plugin is slightly more involved than other plugins, but once you understand how it works, you’ll find it relatively simple.

Install the Plugin

The first step is to install the plugin itself. This won’t change the layout of your site in any way (yet), so you can install it whenever you like. Click here to download the plugin.

Install a Widget

The next step is to install the plugin or theme component containing the widget you want to use

Find a Widget

Widgets can be packaged in Discourse plugins or theme components. We maintain some open source widgets packaged as themes that work with this plugin:

You can also hire a developer to build a new widget or plugin for you. As most widgets are relatively simple from a technical standpoint, and the developer doesn’t need to worry about how the sidebars actually work, this can be done relatively cheaply. For more on widget development, please read the widget development guide.

We’ll use the Category List Widget as an example for the rest of this guide.

Install the Widget

You install the widget plugin or theme component in the same way that you would install any other plugin or theme.

Enable the Widget

If the widget plugin has an “Enabled” setting, this must be turned on for the widget to work. To “enable” a widget theme component, it must be added to any themes enabled on your site. If the widget theme component is built correctly (see our widget development guide), you can add it to your themes safely at any point. The widget won’t actually appear until you set it up. But it must be added to your site themes as a component to work.

Once you have installed and enabled your widget do a page refresh. This allows the code to get loaded properly on your site.

Example

For the Category List Widget, we could first install it as a theme component.

Then add it to our active themes, and refresh the page.

image

Set up the Widget

Once you have both the Plugin and your Widget installed, you need to set up the widget for it to appear on your site. Got to yoursite.com/admin/layouts and you’ll see a page that looks like this.

Click “Add Widget” and then, if you have installed your widget theme component correctly, your widget will appear in the widget select box.

You then need to configure your widget settings. Please see the Widget Settings topic to understand what each setting does:

https://discourse.pluginmanager.org/t/widget-settings

Once you have configured your widget settings, enable the widget by clicking the “Enabled” checkbox and click “Save”. Your widget will appear according to your settings when you refresh the page.

2 posts were split to a new topic: Exception on forum homepage

Hello, that plugin is etxactly what I want.

May I know the name of this widget, which one in red square?
It is not Topic List Widget

image

That’s the TOC Theme Component? It’s not a layouts widget.

https://meta.discourse.org/t/discotoc-automatic-table-of-contents/111143?u=merefield

Thanks @merefield That will help me!

Hi friends. Just wondering if there’s any existing code for the right-side widget that displays the thumbnail map from the Locations plugin.

I wasn’t sure if it was best to ask here or in #discourse:locations, but if anyone knows the story of this widget I would love to learn more. Thanks! :slight_smile:

Hey, great question!

I’ve created a topic for that widget, which is included in the locations plugin itself (tl;dr: if you install the locations plugin the map widget will be available in the layouts plugin)

https://discourse.pluginmanager.org/t/map-widget

Hi @angus - I’m having a crack at installing the Category List widget to https://healthforum.nz but can’t seem to make it work.

All the installation steps have gone smoothly, and the Category List Widget is installed and Enabled. I have started with a with vanilla configuration.

image

However, the sidebar just isn’t appearing. Am I missing something obvious?

Hey @Nathan, I think I can help you with this. :smiley:

It looks like you have everything enabled correctly, but you’re just missing a context to place the category list. In your Layout Settings in the context input selection, you can select an option such as Topic List, and it should appear in a sidebar beside the topic list.

See here for more info. I hope this helps!

It sure does! I’m away.

@angus - it might be helpful for other numpties like me if it defaults to “Topic List”