Forums / General / blog comments hidden by default

blog comments hidden by default

Author Message

Mirko Battisti

Monday 15 June 2009 6:36:56 am

We are implementing a blog connected to a website we're developing.
We started from the classes and templates found in ezwebin.
The default way is to allow comments only to registered users. If I give anonymous user the permission to create comments, then everybody can comment. But there is no filter, no moderation of any kind, so that the comments are visible on the website.
Is there a way to make comments hidden by default?

I was thinking about adding an attribute to the comment class, and check that attribute before showing the comment, but I think that hide/show is easier for the moderator.

Another thing: I would like to show the comment form straight after the blog post.
What I don't totally get is how the creation of the object (comment) works: I'm not sure where it gets its ID from once the comment form is submitted, and what happens if the submission fails (I would like the user to see the error message on the blog post page and not on the comment page - in fact I wouldn't have a comment page at all). Is it feasable?

Thanks in advance,
Mirko.

Jean-Luc Nguyen

Wednesday 17 June 2009 12:56:57 am

Hello,

I don't know if you can hide objects by default, but you can:

- As you said, add an attribute to the comment class, "status", with values "waiting for validation, validated, rejected".

- Use the workflow module, where the admin can approve / reject the comments.

http://www.acidre.com

Ivo Lukac

Wednesday 17 June 2009 1:08:51 am

If you want to make object hidden after first publish you can do it adding next lines under form tag in your edit template:

{if $edit_version|eq(1)}
	<input name="FutureNodeHiddenState_{$main_node_id}" type="hidden" value="hidden" />
	<input type="hidden" name="MainNodeID" value="{$main_node_id}" />
{/if}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Mirko Battisti

Thursday 18 June 2009 5:05:13 am

Thanks Ivo,
I've tried your suggestion and it works fine.

And thanks Jean-Luc, your solution is probably more elegant. I haven't tried it yet, but I'm planning to look into the creation of an approval workflow.

Thank you very much!
Mirko.