Drupal Tips Monday: Make CCK Nodes Look a Little Prettier

February 09 3 Comments Category: Drupal Monday

Being inexperienced with the ways of PHP and hardcore Drupal modification, I needed to do one simple thing, make my CCK node title all H3 headers.

It took lots of head banging to figure this out.

There are Drupal modules that can supposedly template a CCK node, such as Contemplate. After days of messing with it, I could not figure out how to use it.

Frustrated I decided to poke around the CCK module code and discovered a quick work around. All I needed were CCK node labels to be printed on the page as H3 headings. Turns out I could do this easily by editing one simple line of code in the CCK template theme files.

In the CCK file modules/cck/theme/content-field.tpl.php there is this line of code:

[code lang="php"]

[/code]

All I needed to do was wrap the label in the H3 tag. Like this:

[code lang="php"]

[/code]

This simple little trick displayed all my CCK Node Label Headings as H3 headers and it looks great. It breaks the content on my page perfectly and creates a better reading experience.

3 Responses

Write a comment
  1. Could you please explain CCK for us less smarterized in the mighty ways of Drupal

    SEO Copywriter Chicago 9 February 2009 at 10:23 am Permalink
    • I plan to do a whole series on Drupal and it’s esoteric range modules, including CCK. Stay tuned.

      admin 9 February 2009 at 10:30 am Permalink

Trackbacks/Pingbacks

  1. Best posts on Niche Blogger Today from Feb 2009 | Niche Blogger Today - 01. Mar, 2009

    [...] Drupal Tips Monday: Make CCK Nodes Look a Little Prettier Posted on Monday, February 9th, 2009 in Drupal Monday – Comments: (2) Being inexperienced with the ways of PHP and hardcore Drupal modification, I needed to do one simple thing, make my CCK node title all H3 headers.It took lots of head banging to figure this out.There are Drupal modules that can supposedly template a CCK node, such as Contemplate. After days of messing with it, I could not figure out how to use it. [...]

Write a Comment

Commenter Gravatar