# Blog post plugin

**URL:** https://meta.discourse.org/t/blog-post-plugin/34739
**Category:** Plugin
**Tags:** broken
**Created:** [October 21, 2015, 12:45am UTC](https://meta.discourse.org/t/blog-post-plugin/34739 "2015-10-21T00:45:02Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 21, 2015, 12:45am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/1 "2015-10-21T00:45:02Z")

</div>

Continuing the discussion from [Could I show the best posts in a seperate view like WordPress?](https://meta.discourse.org/t/could-i-show-the-best-posts-in-a-seperate-view-like-wordpress/34607/2):

**Note: this plugin is broken. It is no longer being maintained.**

**Edit:** I’ve completely rewritten this plugin. See [this post](https://meta.discourse.org/t/blog-post-plugin/34739/21) for details.

* * *

I’ve made a plugin for doing something like this. You can find it here: [GitHub - scossar/discourse-blog-post: Adds a blog post class to Discourse · GitHub](https://github.com/scossar/discourse-blog-post)

It lets you select a category to display with different styles than the rest of your forum. It defaults to the ‘blog’ category, but that can be changed in the settings. It selects an image that has the added class `header-image` and creates a full-width splash image out of it. The styles are quite basic. They mostly involve removing things. At the moment it’s removing the reply controls. That could be changed. It adds the class `blog-post` to the body tag for topics of the chosen category. Custom styles can be added by beginning them with the `.blog-post` selector.

This isn’t quite ready for production. The styles need a few tweaks. Pull requests and suggestions are welcome.

 ![](https://global.discourse-cdn.com/meta/original/3X/5/a/5a7b31e5f07428d359773f4bc43d1d5fc232d213.png)

---

<div class="post-metadata">

### Author: ![11122](https://avatars.discourse-cdn.com/v4/letter/1/6a8cbe/32.png) [@11122](https://meta.discourse.org/u/11122)
#### Post date: [October 21, 2015, 8:02am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/2 "2015-10-21T08:02:15Z")

</div>

I love this blog view, thanks for sharing this with us.

---

<div class="post-metadata">

### Author: ![11122](https://avatars.discourse-cdn.com/v4/letter/1/6a8cbe/32.png) [@11122](https://meta.discourse.org/u/11122)
#### Post date: [October 21, 2015, 8:15am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/3 "2015-10-21T08:15:50Z")

</div>

is it possible to copy a post to post to your blog category? I mean, could i simply add a post from other categories to this post category. I want to use this as a place to show the best posts.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 21, 2015, 3:26pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/4 "2015-10-21T15:26:43Z")

</div>

The way it works now you would have to change the category of your post to whatever you have set as the blog-post category. Maybe it could be setup to work with tags instead, so that if you tagged a post as ‘featured’ it would get this view.

---

<div class="post-metadata">

### Author: ![11122](https://avatars.discourse-cdn.com/v4/letter/1/6a8cbe/32.png) [@11122](https://meta.discourse.org/u/11122)
#### Post date: [October 21, 2015, 3:37pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/5 "2015-10-21T15:37:08Z")

</div>

the idea of tag is brilliant

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 25, 2015, 10:46pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/6 "2015-10-25T22:46:34Z")

</div>

I’ve rewritten this so that it integrates with the Discourse plugin system, instead of just overwriting things with a bunch of jquery. I think it should be safe to use it now.

A `data-max-height` attribute can be added to the background image to set the image’s max height. The image and the layout scale for mobile.

---

<div class="post-metadata">

### Author: ![nukeador](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nukeador/32/107477_2.png) [@nukeador](https://meta.discourse.org/u/nukeador)
#### Post date: [October 25, 2015, 11:00pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/7 "2015-10-25T23:00:30Z")

</div>

Is there an URL where we can see the plugin working?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 25, 2015, 11:34pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/8 "2015-10-25T23:34:32Z")

</div>

No, at the moment my forum is private. Soon I will try to set up a public category on it that I can use for demos.

---

<div class="post-metadata">

### Author: ![nukeador](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nukeador/32/107477_2.png) [@nukeador](https://meta.discourse.org/u/nukeador)
#### Post date: [October 26, 2015, 10:35am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/9 "2015-10-26T10:35:14Z")

</div>

It would be great if you could set this blog view as homepage too :smiley:

---

<div class="post-metadata">

### Author: ![h1onE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/h1one/32/45349_2.png) [@h1onE](https://meta.discourse.org/u/h1onE)
#### Post date: [November 18, 2015, 5:17pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/10 "2015-11-18T17:17:23Z")

</div>

You, @simon, maintain two similiar plugins:

- [Curated Home PLugin](https://github.com/scossar/discourse-curated-home)
- [Blog post plugin](https://github.com/scossar/discourse-blog-post)

Whats their difference?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [November 18, 2015, 5:36pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/11 "2015-11-18T17:36:08Z")

</div>

I’m not going to be maintaining the curated-home-plugin. I really like it and think that something similar to it would be useful for creating a user-friendly homepage, but I think it will be too difficult and time-consuming for me to maintain. If anyone is interested in using the code, I have a version of it up on github. It is working, but has a few issues.

The blog-post plugin is much simpler. It really just adds a body-class for topics in a chosen category so that that category can be styled separately from the other topics. If it breaks with a Discourse update I should be able to easily fix it.

---

<div class="post-metadata">

### Author: ![piratdavid](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@piratdavid](https://meta.discourse.org/u/piratdavid)
#### Post date: [February 9, 2016, 9:34am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/12 "2016-02-09T09:34:01Z")

</div>

I don’t understand how to write blog posts. Can’t find any ‘New post’ or similar when I’m in a blog topic.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [February 9, 2016, 5:12pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/13 "2016-02-09T17:12:37Z")

</div>

The plugin creates blog posts out of topics in a certain category. It defaults to ‘blog’, but you can change it in the plugin’s settings.

 ![](https://global.discourse-cdn.com/meta/original/3X/2/5/255a7624611a46beb2a3232285eb3f8b6c9c3c8e.png)

You then need to create that category in Discourse. Go to ‘Categories\>New Category’ and create your chosen blog category. In my case I created the category ‘discover nanaimo’. Don’t use an old category where you have posts with replies - at the moment blog posts can’t handle replies.

To create a header image, upload an image (ideally at the start of your post) and give it the class `header-image` you can also set the image’s max height by giving it a `data-max-height` attribute. Here’s an example of how to create a header image:

```html
<img src="//testeleven-forum-assets.s3-us-west-1.amazonaws.com/original/1X/be5f722491f0a827b4604f04e8e5de06497cfb72.jpg" width="690" height="460" class="header-image" data-max-height="500">

```

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [February 26, 2016, 11:42am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/15 "2016-02-26T11:42:27Z")

</div>

how can you do this? “to set the blog view as homepage”.

---

<div class="post-metadata">

### Author: ![nukeador](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nukeador/32/107477_2.png) [@nukeador](https://meta.discourse.org/u/nukeador)
#### Post date: [February 26, 2016, 12:03pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/16 "2016-02-26T12:03:31Z")

</div>

> [@Pad\_Pors](#):
>
> how can you do this? “to set the blog view as homepage”.

You can’t, that why I said it would be great to have that possibility :slight_smile:

---

<div class="post-metadata">

### Author: ![shantilal](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@shantilal](https://meta.discourse.org/u/shantilal)
#### Post date: [June 18, 2016, 5:58am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/17 "2016-06-18T05:58:14Z")

</div>

Hi Simon,

Can You help me to setup your plugins into my existing rails application.

Thanks

---

<div class="post-metadata">

### Author: ![marcospreviato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcospreviato/32/54766_2.png) [@marcospreviato](https://meta.discourse.org/u/marcospreviato)
#### Post date: [June 18, 2016, 10:47am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/18 "2016-06-18T10:47:02Z")

</div>

@simon You have plans to make it work again someday? I did not get to test but it seems wonderful!

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 18, 2016, 4:08pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/19 "2016-06-18T16:08:06Z")

</div>

It’s hard to find the time to update it. I think it’s a lot more straightforward to use WordPress for this kind of thing, with the wp-discourse plugin.

---

<div class="post-metadata">

### Author: ![marcospreviato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcospreviato/32/54766_2.png) [@marcospreviato](https://meta.discourse.org/u/marcospreviato)
#### Post date: [June 18, 2016, 4:08pm UTC](https://meta.discourse.org/t/blog-post-plugin/34739/20 "2016-06-18T16:08:56Z")

</div>

i understand! thanks for reply!

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 27, 2016, 1:41am UTC](https://meta.discourse.org/t/blog-post-plugin/34739/21 "2016-10-27T01:41:08Z")

</div>

Thanks to @smartwatchme for funding it, I’ve rewritten this plugin to work with recent versions of Discourse. It now allows you to configure which groups should be allowed to create ‘blog-posts’ (admins and moderators by default), and which categories blog posts should be allowed to be created in. Members of allowed groups can convert the first post in a topic from a regular post into a blog post by clicking on the ‘book’ icon that’s found in the hidden (‘…’) post menu buttons.

The plugin converts the first image in a post into a header image. It also adds the css class `blog-post` to the `body` tag, and the css class `blog-post-content` to the cooked content of the first post. It comes with some default styles that are used to style the first post in a topic separately from the replies.

The default styles can be disabled by deselecting the plugin setting the `blog post use default styles` setting. This could be useful if you only wish to use the header-image functionality of the plugin. See the plugin’s [README](https://github.com/scossar/discourse-blog-post) for more details.

Pull requests, especially for improving the default styles, are welcome.

 ![](https://global.discourse-cdn.com/meta/original/3X/3/b/3b684ec3a442b3936e5d275843b531d68f8d9261.png)

[Next page](https://meta.discourse.org/t/blog-post-plugin/34739.md?page=2)
