Any way to allow empty posts?


(JC Ford) #1

I’m converting from a forum where users are accustomed to being able to just type a subject/title. Discourse doesn’t seem to allow that out of the box and requires text in the post body.

Would be great if I could just specify a default body like “-no text-” or if it could just duplicate the Title as the body.

Any support for this? Or plugin?


(Bhanu Sharma) #2

Set the following settings to 0

min_post_length
min_first_post_length

This should allow you to import/create posts with only title and no body content.


(JC Ford) #3

Do I have to do that in a config file or something? If I try through the admin interface it won’t accept a value < 1


(Bhanu Sharma) #4

@pfaffman Is there a way to overcome the internal fail safe of discourse? maybe by using rails console or something? I’m not really sure and couldn’t find anything relevant if a setting can be set to a value outside of the min & max limits without ultimately breaking everything?


(JC Ford) #5

Might be something that requires a plugin. Simplest would probably be one that lets you set a default message body for posts where it’s left empty.

Replies should obviously require text in the body since they can’t have their own title.


(Bhanu Sharma) #6

That maybe achieved with a simple hack: setting the min values to 1 and then appending something like &nbsp; but I wonder how can all the posts be modified to add a whitespace?


(Jay Pfaffman) #7

I don’t know off-hand. I’d try like

rails c
SiteSettings.min_first_post_length=0
SiteSettings.min_post_length=0

but I’m 99% sure that the same limits will be enforced.

What I’d probably do is just have the importer duplicate the title (or some generic text) in the post if the post is empty. No plugin required.

I think that you could do something like <div>&nbsp;</div>. I’ve seen posts where people complained that users were cheating the post requirements in similar ways.


(Bhanu Sharma) #8

So can an importer be programmed to loop in just a whitespace where the post data is blank? I hope it can be!

Ps: limits do apply that’s why I looped you in.


(Jay Pfaffman) #9

Not sure. A trick like I suggested would probably bypass the minimum post limit while still appearing to be blank.


(JC Ford) #10

The ‘appearing to be blank’ bit is less important than the user not having to go to the body and type something. It’s an unnecessary extra step when they’ve said all they meant to say in the title.

And I know it’s a fairly minor inconvenience. I’m just trying to grease the new forum adoption wheels.


(Kane York) #11

Oh, did you notice the feature where if you paste a link in for the topic title, it gets replaced by the title of the link & the body gets filled in with the link itself?

That’ll probably reduce some of your “I want to post fast” friction.