Common field names?

(Daniel Hollands) #1

This isn’t really something I’ve considered too much before, but in a similar vein to my Sign Up, Sign In and Sign Out Vs Register, Login and Logout question, what titles do you tend to use for common and generic fields in a database?

The sorts of field I’m talking about are ones like title, as in field that would be used within the <title> or <h1> tags. Or maybe that should be more specific such as page_title, allowing for the use of a meta_title, or maybe it should be heading?

What about the page content? Maybe that should be body? Or something else?

There are a few others out there which I think are common enough that people must have come up with a convention, such as preview or teaser for any shortened version of the aforementioned content to use within listings, etc…, but these are the two above are the ones I think I encountered the most.

What do you folks think?

(Alex Russell) #2

I always used:

  • meta_title for a CMS-like page where you specify the <title> content
  • content for the page content
  • summary for teaser/preview text

On things like categories or products, etc. ‘titling’ was more interesting. Some things sound better as name and some as title: product name, category name, blog post title. I admit to not being overly consistent here - I used what felt best (see previous sentence) and just dealt with my choice when it came to coding inconsistencies. Of course if you give you models a “toString” like method (I use label or getLabel a lot) it lessens that issue.

(Daniel Hollands) #3

Ah yes, I find myself using title and name a fair amount, depending on the context much like yourself.

(Andy Wootton) #4

I suspect text processing systems like LaTeX, SGML, DocBook XML and DITA have required people to think about this quite hard. They probably all came to different conclusions but it might be worth a look. I think that was a chronological list.