Drupal Tutorials > Other Useful > Taming Drupal Node Teaser and Node Title

Taming Drupal Node Teaser and Node Title

categories: Other Useful, Views
for Drupal: D5
1

You might be wondering what is the use of this article / tutorial when Drupal system of handling title and teasers is so good and there are modules like node teaser to customize the teaser as per your need. But lets picture a scenario you are developing a website with a custom front page (required by majority of websites) so you have created your page-front.tpl.php and created a panel kicking out your left and right sidebar selection and example below.

Now the problem is you can tell the people who create nodes to put a title of just five words or less and a teaser of 300 characters or less so what to do? If they put a node title of more than say 25 letters your design will be hampered so the solution is tame your Drupal title how is what you get below:

In your node.tpl.php (recommended node-content_type.tpl.php for better results)
The original code to render node title is something like below (I’m using Amor_Azul theme, just find the $title printed in your theme’s node.tpl.php):

(Taming Drupal Node Teaser and Node Title >>)

ingridients (modules): views

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
233 Drupal Tutorials and counting!