Plugin to Allow Choice of Discourse Category?


(Christian Simplicity) #1

I am beginning to experiment with the WordPress plugin so that my blog and forum can use the same comment system.

I noticed that blog posts can only get created as a topic for one category. It would be nice if we could choose what Discourse Category to create a topic under at the post and page level rather than having forcing them all to go into one Discourse Category.

Any chance that is on the plugin road map?


(Sam Saffron) #2

We are totally open to PRs in this department but loath to work on PHP code so this is not on our roadmap.


(Christian Simplicity) #3

Sorry, if I’m displaying my ignorance, what are PRs? In my world their press releases and I’m sure that’s not what you mean.

Okay, so it’s not on the roadmap. Let me ask a follow on question . . .

I am developing a blog / community site with Wordpress and Discourse as the engines.

All posts on the blog will fall into one of several categories: God Ideas, Finding God, Mindfulness, Simple Living, Money Lies, Dollars & Sense.

The forum also has categories: Introductions, God Ideas, Finding God, Mindfulness, Simple Living, Money Lies, Dollars & Sense, Family Room, Lounge, Staff, Meta, Uncategorized.

A reasonable expectation from the community is to have

  • one user / membership system
  • post comments to use Discourse and not Wordpress or another comment system
  • topics for each post in their respective (matching) Discourse category

Will the plugin help me achieve that? It seems like it won’t if the posts all go to one category. Can what I’m trying to accomplish only be done by manually creating the topic for every post and then linking so the discussion at the end of the post? I suppose doing that will work, but then I’ll have no integration of comments back to the blog post page.


(Konrad Borowski) #4

Pull Requests. If somebody is willing to code this feature, this will be included.


(Christian Simplicity) #5

I really like Discourse’s forum capabilities over Muut. I also like the idea of Discourse as Open Source. But I think one area where Muut gets it right is this idea of website blog comments / discussion forum being unified. From their manifesto . . .

Unified
There should be only one system for all website discussion
Muut is the only product to combine forums and commenting under the same, consistent user experience. This way your site can use only one system for all the discussion. This is, quite frankly, the only way to do it:

The users will experience the same user interface and design
Users have to login just once for access to both
No separate storage for users or posts
All content is accessible via the same feed and search
Without Muut the users will need to comment using one platform, then use something completely different for forum discussions. That’s redundant complexity for everyone.

Discourse seems superior (or at least more mature) in most every aspect but this one for those of us who really want to integrate our forum as part of a blog.


(Michael Downey) #6

How does Discourse fall short on any of the items in this manifesto? AFAICT all of these items are available now.


(Christian Simplicity) #7

I don’t see how Discourse integrates with Wordpress. It still seems to me that “you have to comment using one platform, then use something completely different for forum discussions.” The only alternative is using the Discourse WordPress plugin, but that stuffs everything into one category. It’s not really a clean integration into discussion at the post level.

Is there a way to easily handle this community functionality integrating the two?


(Adam Capriola) #8

I change the category of the topic once it’s created in Discourse if need be. It’s a little extra work, but not a dealbreaker in my eyes.


(Christian Simplicity) #9

I didn’t know it was that easy. :facepalm: :blush:

Will the top comments remain “linked” and fed back to the blog post in that case?

My first thought was to simply not have any comments allowed and create the topic and provide a link to it from the blog post. Your way seems easier.


(Adam Capriola) #10

They should be. The URL isn’t altered when you change the category.


(Adam Capriola) #11

Today I decided I was tired of manually changing categories, so a made a slight customization to the plugin. If you are comfortable with modifying code, in the wp-discourse.php file add this to the sync_to_discourse_work function before the $data array:

if ( in_category( 'wordpress_category', $postid ) ) {
	$options['publish-category'] = 'discourse_category';
}

Change wordpress_category and discourse_category and add more clauses as needed. Pretty simple.


Request - Wordpress plugin, Publish to Discourse option to include category
(Holden) #12

Hi @adam,

Is it possible for you to add something like this to the official plugin?

It would be great if we could easily map Discourse Categories to WordPress Post Categories in the Official WP Discourse Plugin settings. Something like this:

Map Categories
Map WordPress Categories to Discourse Categories
[wp_category_dropdown] posts to [discourse_category_dropdown]
[add_another_button]

Thanks!


(Adam Capriola) #13

The functionality you’re looking for might be available already:

I’m still on an ancient version of the plugin because it does the job for me. Haven’t tried out @paxmanchris’s build.

(Also I’m not @Adam … think I was too late to the party to register that username!)


(Holden) #14

Hey Adam,

Sorry I got your name wrong and I’m glad you still found my post. Cool, I’ll check out that version of the plugin – thanks. Am I correct in understanding that that version might be merged with the official version soon?

Still, it would be cool if we can map categories along with a default just in case a category isn’t mapped so we can set it and forget it, rather than having to select a category for each post. Either way works.


(Erlend Sogge Heggen) #15

Well, @paxmanchris hasn’t been around for a while, so it’s hard to say. @benword gave him some pretty in depth feedback, so someone with some PHP-savvy could probably finish cleaning up the pull request easily enough.