Thank you so much @Richie!! Out-of-the-Box is my entire World!
There’s a typo in your code, a double semicolon:
.topic-body h1 {
padding-top: 0 !important;;
}
Also,
Did you forget to post your image? Unless the After version of your page is just music
I played a bit with your code and that’s just brilliant!
We could add some advice for using this trick depending on your needs.
-
Your topics could be closed to prevent people circumvent the CSS rules and reply to them
-
Your topics could be unlisted to not add noise to topic lists or appear in the search results
-
The tags could be in a tag group invisible to regular users to remove noise in the tag lists
-
You could hide some elements only regular users but not for the admin (like the post menu)
That just came quickly to my mind, but I suppose there are other things that may be thought about.
Thanks @Canapin I fixed the code typos.
Categories and Sub-Categories can also be used in CSS by using category-
i.e…
.category-books .main-content,
.category-my-great-book .main-content {
width:100% !important;
}
I’m also using this trick on my site extensively, to style content and embeds on-the-fly inside the composer…
I have a section of my site where I document my developments (mainly so my future self can recall and find what I have already done, so I don’t continue to reinvent my own wheels!) But anyone is welcome to visit and/or subscribe to that category if you’d like…
Oops; my adblocker somehow blocked your second image, weird.
For those who want to see the pages live:
https://noobish.me/t/open-source-culture-no-tags/525 → https://noobish.me/t/open-source-culture-with-tags/320
Neat.
This is awesome!!! Thank you for sharing!!!
This deserves it’s own “how-to” entry
One obvious drawback to using CSS for “removing” content, is that it’s not actually removed, just hidden. Therefore you’re loading data that your client won’t be using.
My intention with this question below was to determine a common way for Discourse practitioners to recognize a way to the discussion across instances.
@hellekin “across instances” of what?
Are you using Wordpress?
… or Ghost?
There is a new, even tighter integration with Ghost and Discourse that enables Single Sign On…
There is also this plugin…
Across instances of Discourse.
Hello, I currently have a discourse site that requires login to see and do anything. I want to use the publish topic feature to create a homepage for my users but since I’m also using secure media, I’m getting the below error. Is there anyway around this? I tried the procourse-static-pages (doesn’t work with the latest version of discourse, I’m unable to save a new page. The security group drop down box is not being populated so that might be the issue) and discpage (doesn’t seem to work with a custom theme I’m using) plugins. So I’m really hoping I can get this feature to work. Does anyone have any advice?
WoW!
What an amazing tweak you’ve made out of Discourse, congrats and thanks for sharing :)
this is very cool. well done and thank you for sharing
Thanks, @brasofilo and @Lilly! I’m planning some Theme Components based on this, and related use cases.
Unless I missed something on this feature, the published page only shows the initial post, not the answers to it. If that’s the intended behavior, is there a way (plugin?) to make the standalone page also show all the replies to the initial post?
Hi Raphael,
This is the purpose of published pages.
Published page has limited access to many Discourse features.
The only workaround would be using a trick like Page Publishing - #145 by denvergeeks but the published page won’t have a custom URL (and will load useless thing in the background).
Hello Danielle,
Unfortunately, I have no other advice than opening a new feature page-publishing topic and ask if something can be done about it.
Pay Publishing is a cool idea and feature that’s new to me and in particular the above is how I assumed it might work too.
This would opens up the ability to present content with more control while having the majority of your discourse logion_required, best of both world, you may still need to hook in new users or ut valuable information you want ot leave open to all on the web, including crawlers.
A simple option like:
Allow Published Pages Display on Login_required page
Would be a good start.
Maybe the /pub/ could also be a default landing page to display all pub pages in a simple list preview, as a matter of course.
I really didn’t know this feature was available until investigating login_required.
Indexing Published Pages
While we’re waiting for the Index or search published pages feature, here is a way to do it manually.
Finding Published Pages
Using the Discourse Data Explorer you can create a new Published Pages query:
SELECT CONCAT('/pub/', pp.slug) AS URL, pp.topic_id
FROM published_pages pp
ORDER BY pp.id
Providing an Index
Surely one can Run Data Explorer queries with the Discourse API to create and maintain an index of published pages. This might even be doable with the Custom Wizard Plugin 🧙.
I manually created a new topic using the data from the Published Pages query above, then published it at /pub/index
.
Since I Run other websites on the same machine as Discourse, I could easily make the published pages index available at https://discourse.example/pub
with this snippet:
# Provide an index to published pages
location ~* ^/pub/?$ {
return 307 https://discourse.example/pub/index;
}
Adding my name to this list
Is there a way to alter the routing to remove the /pub/
from the URL of the published page?
For example, this published page:
https://example.com/pub/my-magic-page-here
Would become:
https://example.com/my-magic-page-here
Hi @Richie - you can do this with permalinks (admin-customize-permalinks). Put the “my-magic-page-here” slug in the first field, use the External URL option in the drop down, then add the published page URL in the URL field. Note however, that the permalink won’t work as a URL in a custom menu section, still need the actual published doc URL.