Plugin outlet locations theme component

theme-component

(Richard - DiscourseHosting.com) #1

Continuing the discussion from Plugin Outlet Locations:

I needed an updated version with all the plugin outlets that have been added recently and then I realised that it would be really easy to create a theme component for this, so there is no need to install a plugin any more.

The readme includes a script that will auto-generate the outlets based on the Discourse source code.

   #!/bin/bash
   grep -r plugin-outlet /var/www/discourse/app/|grep name|grep -o -e 'name=".*'|awk -F\" '{print $2}'|sort|uniq | while read p ; do
     echo "<script type=\"text/x-handlebars\" data-template-name=\"/connectors/$p/plugin-outlet-component\">"
     echo "<div class=\"outlet\">$p</div>"
     echo "</script>"
   done

Theme preview: Discourse Theme Creator


Plugin Outlet Locations
Beginner's Guide to Creating Discourse Plugins Part 2: Plugin Outlets
Plugin Outlet Locations
Discourse Development Contribution Guidelines
(Erlend Sogge Heggen) #2

Super useful! Could you please add a couple of screenshots of what this looks like in practice?


(Richard - DiscourseHosting.com) #3

Of course - see above :slight_smile:


(Jeff Atwood) #4

Didn’t @Mittineague write something like this before?


(Richard - DiscourseHosting.com) #5

Yes, see the link at the very top of this topic, that refers to the topic about that. @Mittineague wrote a plugin in 2015. I was using it and then I found out that it needed to be updated (it hadn’t been updated for over 2 years).

The next step was me realizing that this could be done much easier now using a theme component.


(Mittineague) #6

Yes, I had started to update the plugin to take into account the changes in the number and locations of plugin outlets a few weeks ago, but other priorities moved it down on my ever growing todo list.

If the same information can be provided as a theme component that works in the GUI and doesn’t require editing app.yml and running launcher I think it would be easier for most. I may be wrong, but I have a feeling most prefer GUI over CLI.