Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm working on a CMS that will be used by others and I'm trying to figure out what the main body of the site page should be called.

Originally, I was going to call it "content" - but perhaps "body" or "page" would be better.

<html>
<body>
    ....
    print $content;
    ....
</body>
</html>

This isn't just a question about markup class/id names. It's also about what the name means to people when they first hear it. I want people to know that ____ is the main area of the page.

share|improve this question

migrated from webmasters.stackexchange.com Jan 29 '12 at 19:46

This question came from our site for pro webmasters.

1  
I don't know, but: main-content perhaps? ;) –  PeeHaa Jan 29 '12 at 2:34
    
Whatever you want to call it. –  Dynamic Jan 29 '12 at 22:18
add comment

3 Answers

up vote 3 down vote accepted

At the end of the day anything along the lines of 'content' or 'body' should be fine, as long as you are consistent about using that term throughout your system (both in the front and back end ideally).

For what it's a worth, a quick survey of what some popular CMSs are using for their main text areas (thanks http://www.opensourcecms.com). Yes, these are field names, but 80% of the time this is what will end up in the template, e.g. WordPress "content" -> "the_content()":

  • Drupal = body
  • Joomla = articletext
  • Wordpress = content
  • Typo3 = content
  • MODx = content

I guess content is probably the safe option if you want to go with what is popular anyway.

share|improve this answer
add comment
  1. Your snippet suggests you're after what to call the templating variable/function. Use whatever you want; it's your app. Most tend toward generic terms, since you aren't necessarily dealing with "pages":
    • WordPress: the_content()
    • Movable Type: <$mt:entrybody$>
    • Drupal: $content (though this dumps out all the content, not just the single field)
    • ExpressionEngine: {body}
    • MODx: [[content]]
  2. But you say it's maybe also something to do with id or class names. That's determined by what theme is applied and you have no control over it(other than forcing people to use themes you provide, I suppose).
  3. Then @incarnate's answer provides the names/labels of the content fields within some applications' admin areas, which is again something else entirely.

Whichever it is you're after, no real standard exists or particularly needs to. It's not like you're able to take a WordPress template, dump it into a Drupal installation and have it work. And nobody reasonably expects their ExpressionEngine knowledge to directly translate to Movable Type.

Whatever you decide to use, what's more important is that it ideally be consistent with the rest of your terminology(asking what to name a single arbitrary-to-us variable is a waste of time) and that you provide documentation for it.

share|improve this answer
add comment

Whatever you do, if its a commonly used word or phrase, then namespace it with a prefix.

This will help avoid conflicts during development, when integrating with other software, and beyond.

e.g. mjw-mainContent mjw-main-content

I usually use the initials of the website, but anything will do really.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.