the right way to show content in themes

63 views Asked by At

I'm new with drupal 7 and now I'm having a hard time with theme's coding, if more specific, I don't know how I should show pre-defined content. Previous developer of project said, that I absolutly shouldn't use/hardcode any content and links directly in template files and I should put it to modules/blocks (with regions). It would be ok, but design I'm coding now is too complex and has much content and just writing module for each thing - it take too much time.

I have very similar design to this one: http://classter-html.themerex.net/

So, what is the best and right way to show content (and links) in templates? Of course, I could just hardcode it, but I'm kind of person, who follows good practices.

2

There are 2 answers

0
Anders On BEST ANSWER

Let's look at the example site you gave. In Drupal it would be set up something like this:

  • The carousell at the top: Slick
  • Classter Team: A View of content type "employee" displayed in a block.
  • The photos: A View of the files, or of a photo content type. Or one of multiple purpose built photo album modules.
  • Application Features: A block with custom HTML-code.

Things that only show up at one page (like the start page) can be done using full HTML in that nodes content. Views and blocks with HTML usually solves the rest.

0
MilanG On

If you are sure that some content will never change (is not translatable or something) I don't see why you shouldn't hard-code it.

Regarding hard-coded links, use root relative paths, so if you move your site to some other domain they will still work.