Static Pages Plugin (dl-static-pages)

(Joe Buhlig) #1

I’ve been doing freelance Discourse customization as my primary gig for almost a year at this point. And one of the most common questions I get is about static pages. “Can I just create a static sales page?” “Where’s a good place to put a FAQ without a discussion around it?”

You can likely argue the validity of these questions in most scenarios. The main response being “just close the topic.” But that doesn’t cut it for most. Thus, I decided to create this plugin to make it possible.

It’s pretty simple. You get a backend under Admin > Plugins to create, edit, and delete these pages as you like. It uses the same topic composer we’re used to. Once you have the page built, you can Enable it and share the link to the page wherever you like.

For a demo:

This plugin is the first where I’m trying out a tiered process. You’re free to use the plugin if you want one or two static pages on your site. More than that and you’ll need a license key, which will also grant you access to the support category for the plugin on the Discourse League site (not affiliated with the Discourse team themselves). You can get a key by clicking the button at the bottom of the demo above or by going here.

I should also note that styling is made easier with a class static-page in the wrapping div for the whole page. That way you can do whatever you want to the body of the page from a CSS standpoint.

Custom Homepage Plugin (dl-custom-homepage)
Easy to use static pages plugin
Create a custom page
Creating a new path (url) with static data
Advertise activity in a private category (discourse-category-lockdown)
Static Pages Plugin - Meta description the plugin?
Static Pages Plugin - Meta description the plugin?
How to place a folder with html files on a discourse setup?
/about page add a new link and menu
What plugins do you use - and why?
Easy to use static pages plugin
Help! I need to contact discourse support team for corporation!
Building New Topic Lists
Feature request: Permalinks like TOS to function as static pages
Static pages plugin
404 rendering at custom route without redirection
Employee Portal "Non-Forum" Pages

I’ve installed it! Not sure if I saw that you could do this (or not)… but easy to add custom embeds (like google maps etc)? Didn’t appear easy to do via the WYSIWYG…?

(Joe Buhlig) #3

It follows the same rules as applied to creating a new topic currently. So any embeds you allow via iframe in your settings will be respected.

That said, I like the idea of allowing html on the backend for this.


hmm. it doesn’t render. like a basic youtube embed.

(Joe Buhlig) #5

This is easily the biggest request I’ve had for the Static Pages plugin:

There is now a checkbox on each page to switch from using the composer to adding raw code for the content.

It uses the same ace-editor we use when building themes. So it should feel very familiar.

(Chris Croome) #6

Would it be possible to use this plugin to create pages that are readable by the public, without a login, on Discourse sites that are set to be private?

In the same way that the terms of service and privacy policy are?

I have found that by default the static page plugin URLs redirect to the /login page on sites that are private.


Having some issues… checking the html box makes this disappear:

(Joe Buhlig) #8

Are you getting anything in the error logs on this one? Or even in the console? I’m not finding any issues with it on my end.

I know. I know. Typical developer response. :wink:


Would it be possible to share files via a static page, e.g. Word, PDF or JPEG files?

(Joe Buhlig) #10

It uses the same composer as we use for new topics and posts. So if you can post it there, you can post it in a static page.


Good to know! That might be a better way to share documents that are being updated from time to time.