Blog post plugin

I haven’t looked at this in over a year, so I’m not surprised that it’s broken. Since Discourse now adds a Category class to the body tag, it should be fairly simple to give individual styles to categories. For example, this post has the class category-plugin-broken-plugin to indicate its parent and sub category.

3 Likes

Just checked the source on the body tag on my Discourse and there is no category class there. Is that supposed to be on by default?

Yes, it should be added. You need to select ‘inspect’ for the page, not ‘view page source.’ On Chrome, right click and select ‘inspect’ from the menu. On Firefox, select ‘inspect element.’

ok, I see it now. That’s … weird. Why doesn’t the page source show css classes, is that an ember thing?

Going to load your plugin’s css on one of my categories… fingers crossed.

It’s added with javascript.

Ok this is quick and dirty. I used the css below to hide some page elements give a more streamlined look to posts in a given category. It’s not a blog, but it’s something.

.category-your-category-name .topic-meta-data {
  display: none;
}

.category-your-category-name .topic-avatar {
  display: none;
}

.category-your-category-name .topic-timeline {
  display: none;
}

.category-your-category-name #topic-footer-buttons  {
  display: none;
}

.category-your-category-name #main-outlet {
  padding-left: 40px;
}
1 Like

So the plugin working ? or not?



NOT WORKING!

This plugin is not working. That is why this topic is in the #plugin:broken-plugin category.

9 Likes

Any real alternative to this plugin? I liked how the blog was shown and I don’t really like how WP-Discourse works

The easiest alternative would be to use the category class that is added to the body tag of each Discourse topic to create CSS styles for a category. I think that everything this plugin was doing can now be done in a Discourse theme.

4 Likes