I'm using Drupal 6. The node has been created with 10 rows.

I'm looking for ways to make the table content viewed on the front page with 5 rows, where it has "more" link to the full node.

It can be PHP code to be placed in the block, or any other ways. Any suggestion are welcome including modification on other modules.


You need to focus on node template.
Override or create a tpl of your content type e.g. node-type.tpl.php
User $node object to access all your cck fields.

Also care about $teaser and $page flags to get the state of your node.

If $teaser is true then render 5 items from $node object. If $page is true then render all your items.

  • I'm using <?php print_r($node->field_thetable[0]['value']) ?> where the output is the table content, but it showed in long text rather in table. By the way, I don't know how to limit the item. – mahai Jul 18 '11 at 18:20
  • How is your field containing rendered output. Have a try to reload node object using node_load() function. $node_obj = node_load(array('nid' => $node->nid)); Then print_r($node_obj) to match it with existing $node object. I am considering your field as multi valued field with raw data. If this field is single valued and having html then no easy way to limit the rows in teaser. – Shoaib Nawaz Jul 18 '11 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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