Why aren't comments a type of post with a content type of comment,
with a relationship to a post of another type (entry or page)? As far
as I can see there's a distinction being drawn between content that's
created by a blog's authors and content created by others. But when
thinking about content types recently (in the context of creating a
'discussion' type) I've had a vague feeling lately that this is a bit
arbitrary and limiting.
Obviously there are lots of web services (in a generic sense) being
developed where the 'others' are the primary producers of content.
Think Digg, or even Twitter (yes, we could argue about that, but
that's not my point). I think Habari is in a good position to be able
to be a platform for services like that.
So, would it make sense to reimplement comments as a kind of post, and
use this as an example of how posts can be related to other posts,
either of the same or different content types?
Anyone have any thoughts?
--
Michael C. Harris, School of CS&IT, RMIT University
http://twofishcreative.com/michael/blog
Posts have the following characteristics about them stored in the DB:
id, slug, content_type, title, guid, content, cached_content,
user_id, status, pubdate, updated
Comments have the following characteristics about them stored in the DB:
id, post_id, name, email, url, ip, content, status, date, type
If we were to store comments as a new post type, we'd necessarily need
to generate slugs and GUIDs for each comment (not necessarily a bad
thing). It also means that for each post we'd be storing an author
name, email, and URL, which doesn't make for a very normalized
database when we have a users table designed to hold that stuff.
An early idea put forward by Chris Davis was to create a user account
for every person who commented, with the idea that after X number of
comments that account might be "promoted" to be given the ability to
create new posts on the site. Unifiying posts and comments would
perhaps make Chris' idea a little more meaningful.
Renaming "post_id" to "parent_id" would permit us to have a
hierarchical (one-to-one) relationship between posts, such that a page
could be a child of another page. It would also permit us to have
threaded comments pretty easily: a feature quite a few people seem to
like.
I admit that my first reaction to this proposition is a negative one:
I think that the content stored for posts and comments is sufficiently
distinct that we'd be creating long-term headaches for ourselves by
trying to store them both in the same table, with the same set of
columns. It's an interesting idea, though, and I'm willing to explore
it further in discussion.
Cheers,
Scott
What's interesting is that your post here made me think that it's
actually a good idea. Comments are content, and they have the same
things going on that a post does in many ways.
Post => Comment
id => id
slug => this could actually be useful for linking directly to a specific
comment. Rather than http://example.com/post-slug#comment-8019 we could
use something like http://example.com/post-slug/comment-username
content_type => this would obviously be "comment"
title => I can see sites using the ability to add a title to a comment
guid => guid
content => content
cached_content => I don't know what this does.
user_id => could be problematic if we don't require commenters to
"login" somehow, as I'm likely to end up with comments from my brother
ending up with "Geoff" "Geoffrey" "Yamichi" "Little Brother" being
listed as users.
status => status
pubdate => date
updated => I can see the eventual creation of a plugin that will allow
users to edit comments.
? => type (could this simply be an expansion of status?
Plus, the addition of a "Parent ID" would give us the options that
Skippy mentioned as well as allowing sub-pages, which we've seen some
interest in.
This represents a fairly significant change in how "comments" are
considered in the grand scheme of things, and to some extent elevates
them. I don't think this is a bad thing, and in the long run, I think it
would streamline the code somewhat as all content would be handled the
same way.
If nothing else, it's a chance to explore some assumption about content.
- --
Sean T Evans
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH5k4amQpMBUWJpdsRAoVNAJ90zE7m7o6XqINxfu4UONmNSihYLQCdFOIu
SMhEc0fn/nCgPyGo3X5oUBI=
=FP9t
-----END PGP SIGNATURE-----
I haven't delved into content types terribly deeply yet (starting is
what raised the question) but isn't the whole point of different
content types that we can store different information about them?
There is a base level of information stored about posts and comments,
discussions, contact pages and polls each have their own specific
extra data. If that's not easy, the whole idea of content types
becomes much less interesting.
> Renaming "post_id" to "parent_id" would permit us to have a
> hierarchical (one-to-one) relationship between posts, such that a page
> could be a child of another page. It would also permit us to have
> threaded comments pretty easily: a feature quite a few people seem to
> like.
It's partly the relationship between post types that I wanted to
explore. If we can have a simple and flexible way to define a content
type that has certain relationships with other posts, I think
interesting things will happen.
> I admit that my first reaction to this proposition is a negative one:
> I think that the content stored for posts and comments is sufficiently
> distinct that we'd be creating long-term headaches for ourselves by
> trying to store them both in the same table, with the same set of
> columns. It's an interesting idea, though, and I'm willing to explore
> it further in discussion.
Again, if it is a headache to store different information for
different content types, now is when we should make it easier. Perhaps
we do need a different table for each content type that's created,
rather than just dumping everything in post info.
We could have 'anonymous' as the default author for content created by
'others'.
> Plus, the addition of a "Parent ID" would give us the options that
> Skippy mentioned as well as allowing sub-pages, which we've seen some
> interest in.
The ability to define relationships between posts would give us the
ability to have hierarchical pages and threaded comments almost
trivially, and it's the fact that that would be trivial that makes me
excited about other possibilities I haven't even thought of yet.
> This represents a fairly significant change in how "comments" are
> considered in the grand scheme of things, and to some extent elevates
> them. I don't think this is a bad thing, and in the long run, I think it
> would streamline the code somewhat as all content would be handled the
> same way.
For 'comments' think 'content created by others'.
> If nothing else, it's a chance to explore some assumption about content.
Questioning assumptions has got to be a good thing :)
The point of defining content types is to allow plugins to "do stuff"
with those content types. The example we most often bandy about is
podcasting: a "podcast" content type would allow a plugin to
automatically generate enclosures for linked media. It would allow a
plugin to render a different set of input controls when composing the
item. Most notably would be the input for the media file: this is
something that is useful primarily for podcasts, and not necessarily
useful for posts and pages.
Another example of a content type would be the so-called "CommentBack"
feature discussed on our Summer of Code ideas page.
I'm still leery of the notion of storing comments in the same table as
posts. From a database normalization perspective, it seems wrong to
me to conflate comments and posts together. I admit, though, that I'm
not a DB expert, so I'm interested in the perspective of folks with
more expertise on the matter than me.
> > Renaming "post_id" to "parent_id" would permit us to have a
> > hierarchical (one-to-one) relationship between posts, such that a page
> > could be a child of another page. It would also permit us to have
> > threaded comments pretty easily: a feature quite a few people seem to
> > like.
>
> It's partly the relationship between post types that I wanted to
> explore. If we can have a simple and flexible way to define a content
> type that has certain relationships with other posts, I think
> interesting things will happen.
For the record, I believe this can be accomplished now through the use
of postinfo records. A plugin could create a many-to-many
relationship among posts, whereas the addition of a "parent_id" field
in the core post table would only support a one-to-one (or
many-to-one) relationship.
> > I admit that my first reaction to this proposition is a negative one:
> > I think that the content stored for posts and comments is sufficiently
> > distinct that we'd be creating long-term headaches for ourselves by
> > trying to store them both in the same table, with the same set of
> > columns. It's an interesting idea, though, and I'm willing to explore
> > it further in discussion.
>
> Again, if it is a headache to store different information for
> different content types, now is when we should make it easier. Perhaps
> we do need a different table for each content type that's created,
> rather than just dumping everything in post info.
It's not currently a headache to store different information for
different content types, because all posts have the same set of basic
info. Additional data can be stored in the postinfo table as needed.
Comments have a fundamentally different (albeit similar) set of data,
which suggests to me that they should be stored separately.
I agree that challenging assumptions is a fine thing to do; and I'm
not at all opposed to continuing this discussion. What do folks see
as the long-term benefit(s) of storing comments in the post table?
How will it make things easier for Habari? How will it improve things
for our users?
Cheers,
Scott
By saying "a different set of input controls" you're basically
agreeing with me, "store different information." Why else would you
have different input controls? The inputs all just put stuff in
content?
> Another example of a content type would be the so-called "CommentBack"
> feature discussed on our Summer of Code ideas page.
>
> I'm still leery of the notion of storing comments in the same table as
> posts. From a database normalization perspective, it seems wrong to
> me to conflate comments and posts together. I admit, though, that I'm
> not a DB expert, so I'm interested in the perspective of folks with
> more expertise on the matter than me.
They're just content. If we can work out how we can have "just
content" stored happily, I think we will give ourselves an enormous
amount of flexibility.
> > > Renaming "post_id" to "parent_id" would permit us to have a
> > > hierarchical (one-to-one) relationship between posts, such that a page
> > > could be a child of another page. It would also permit us to have
> > > threaded comments pretty easily: a feature quite a few people seem to
> > > like.
> >
> > It's partly the relationship between post types that I wanted to
> > explore. If we can have a simple and flexible way to define a content
> > type that has certain relationships with other posts, I think
> > interesting things will happen.
>
> For the record, I believe this can be accomplished now through the use
> of postinfo records. A plugin could create a many-to-many
> relationship among posts, whereas the addition of a "parent_id" field
> in the core post table would only support a one-to-one (or
> many-to-one) relationship.
For the record, it wasn't me who said anything about renaming post_id
to parent_id. I was suggesting a generic way of expressing
relationships between posts. I can see how this could be done in the
postinfo record. I'm also no DB expert, but I'm not sure that is the
best way to go about it. The more I think about it the more I think a
new content type should automatically create an in info table that
holds information specific to that type.
> > > I admit that my first reaction to this proposition is a negative one:
> > > I think that the content stored for posts and comments is sufficiently
> > > distinct that we'd be creating long-term headaches for ourselves by
> > > trying to store them both in the same table, with the same set of
> > > columns. It's an interesting idea, though, and I'm willing to explore
> > > it further in discussion.
> >
> > Again, if it is a headache to store different information for
> > different content types, now is when we should make it easier. Perhaps
> > we do need a different table for each content type that's created,
> > rather than just dumping everything in post info.
>
> It's not currently a headache to store different information for
> different content types, because all posts have the same set of basic
> info. Additional data can be stored in the postinfo table as needed.
> Comments have a fundamentally different (albeit similar) set of data,
> which suggests to me that they should be stored separately.
Which suggests to me that we are not taking full advantage of content
types, and that there may be some architectural blocks to it.
> I agree that challenging assumptions is a fine thing to do; and I'm
> not at all opposed to continuing this discussion. What do folks see
> as the long-term benefit(s) of storing comments in the post table?
> How will it make things easier for Habari? How will it improve things
> for our users?
I think you're asking the wrong question (although maybe I started
it). What do folks see as the long-term benefit of comments and other
content generated by non-authors being considered posts?
I think I've said what I think, so I'll try to shut up for a while and
see if others have opinions.
>> I agree that challenging assumptions is a fine thing to do; and I'm
>> not at all opposed to continuing this discussion. What do folks see
>> as the long-term benefit(s) of storing comments in the post table?
>> How will it make things easier for Habari? How will it improve things
>> for our users?
>
> I think you're asking the wrong question (although maybe I started
> it). What do folks see as the long-term benefit of comments and other
> content generated by non-authors being considered posts?
>
> I think I've said what I think, so I'll try to shut up for a while and
> see if others have opinions.
>
Perhaps the very idea of "We don't care what kind of content you have,
we want to be able to process it." and "Content is content, regardless
of where it comes from." are good starting points for the pro side of
this discussion (which is where I'm finding myself at this point).
By using comments as a starting point, we have a basis for integrating
this mindset into Habari. Then, when down the road, someone says "I want
to use foo as my primary content type." we're ready to fit it into our
system. Whether this is podcasts, a photo blog, recipes or something we
haven't even thought of yet, we'll be able to say "This is where this
data goes, and this is where the other data goes."
Setting aside whatever we're currently saving for comments,
fundamentally how does a comment differ from a post? Think that for the
end user, there probably isn't much difference between storing comments
in their own table vs. the post table, but I feel that for designers and
developers, having a consistent way of dealing with all the content on a
site would be beneficial. I can envision people making use of tagging
comments, and retrieving for the sake of things like a "recent comments"
thing in a sidebar or even being able to search comments could be made
more simple.
I think this may be the most beneficial aspect of making this change is
that we have a single point of reference to get at content, regardless
of type or source.
- --
Sean T.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH5x5LmQpMBUWJpdsRAsIbAKCwku4EZ9ley89/BwuiEq7yi+Ua/gCcCl7o
Ys6zfqX4vxjsqgKgPtZf2g8=
=UPCz
-----END PGP SIGNATURE-----
I should never say this. I can't shut up :)
> Perhaps the very idea of "We don't care what kind of content you have,
> we want to be able to process it." and "Content is content, regardless
> of where it comes from." are good starting points for the pro side of
> this discussion (which is where I'm finding myself at this point).
>
> By using comments as a starting point, we have a basis for integrating
> this mindset into Habari. Then, when down the road, someone says "I want
> to use foo as my primary content type." we're ready to fit it into our
> system. Whether this is podcasts, a photo blog, recipes or something we
> haven't even thought of yet, we'll be able to say "This is where this
> data goes, and this is where the other data goes."
Looking at it another way, if comments hadn't been built in as their
own type, it would make perfect sense for someone to write a plugin to
create a comments content type.
My relationships between posts argument would be completely addressed
by having a table created for new content types. Comments get a
CommentInfo table, discussions get a DiscussionInfo table and polls
get a PollInfo table, defining whatever data and relationships they
want.
> Setting aside whatever we're currently saving for comments,
> fundamentally how does a comment differ from a post? Think that for the
> end user, there probably isn't much difference between storing comments
> in their own table vs. the post table, but I feel that for designers and
> developers, having a consistent way of dealing with all the content on a
> site would be beneficial. I can envision people making use of tagging
> comments, and retrieving for the sake of things like a "recent comments"
> thing in a sidebar or even being able to search comments could be made
> more simple.
Or having moddable posts/comments.
> I think this may be the most beneficial aspect of making this change is
> that we have a single point of reference to get at content, regardless
> of type or source.
+1
+1 from me for comments as content type.
~Randy
Graham Christensen
http://itrebal.com - Customized Web Hosting
Graham.Ch...@iamgraham.net
I don't see any reason why we can't have content type based filtering.
Graham Christensen
http://itrebal.com - Customized Web Hosting
Graham.Ch...@iamgraham.net
Before getting into implementation details, I'd like some agreement as
to whether or not it's a good idea to have a comments content type. It
seems to me that there is support for the idea, so perhaps it's worth
a branch. Is anyone willing to work on this? I will, but it will very
much be time permitting (and given my work on the other branches I'm
supposed to be working on, time isn't very permitting).
Sorry to be thick but can you briefly explain what you mean by node
level permissions?
So it's possible to have different permissions for a role/group on
individual posts of the same type (group can view entry 1 but not
entry 2), not just each type of post (group can view entries)? I
certainly was not envisioning such granularity.
Of course, however we tackle permissions, there are potential
pitfalls; let's call them interesting challenges.
http://daringfireball.net/2007/07/on_top
Sorry, what was that in answer to?
> Here's how I envision permissions, in order of application
>
> a) sitewide default roles/rules
> b) group rules for entire content types
Agreed.
> c) group rules for single posts
> d) individual rules for single content types
> d) individual rules for single posts
I can't actually see the need in Habari for these. Who would want to
set permissions on a single post or for a single user? It also
increases the required complexity enormously. I'm happy to hear where
these would be useful.
> Actually, I was thinking of crazy awesomeness we could do with the
> ACL: imagine being able to construct rules like iTunes smart folders.
> (Group => developers, tag => code, type => page, view, edit, publish)
That's worth thinking about.
We add a bio content type in a plugin and rely on group permissions to
control their creation and editing. An admin can create and edit any
number of bio pages (and assign ownership to other users) but a
registered user can create a maximum of one and can edit bio posts for
which they are the author.
> Also, in professional environments, this would be quite useful. (You
> wouldn't want that guy from HR to be able to edit the home page
> text, but he should be able to change his contact info listing)
He's in a group that allows him to edit the contact info. The home
page is a theme template (to edit it he'd have to access to the theme,
in which case he can do what he wants anyway) with much of its content
dynamically generated from other posts, which he may or may not have
permission to compose, depending on his group membership.
I'm still not entirely convinced, but feel free to keep trying.
> > > Actually, I was thinking of crazy awesomeness we could do with the
> > > ACL: imagine being able to construct rules like iTunes smart folders.
> > > (Group => developers, tag => code, type => page, view, edit, publish)
> >
> > That's worth thinking about.
>
> I might do a mockup of this, if only for some interesting conversation.
Please do, that would be great.
Help me understand this picture. The rule applies to the group
"Information Technology", and the author must be in the "Information
Technology" group: isn't that redundant?
Have you looked at the existing Habari ACL code?
http://wiki.habariproject.org/en/Classes/ACL
http://wiki.habariproject.org/en/Permissions
I *think* our extant code is functionally similar to what you're
proposing, but it's still early in the morning and my brain is fuzzy.
Can you please review those two links and then let me know what you
think?
The notable difference I see between your rules and our ACLs is that
your rules support operations based on external criteria (username
contains XYZ). I imagine we could do something similar with ACLs, but
it might require some hoop-jumping. Finally, I'm not entirely sure
that such rules would be of sufficient use to most users to justify
the possible complexity they introduce.
Cheers,
Scott