Fix for CCK Text field snippet within node-<type>.tpl.php works

  1. /*
  2.  * Code for BassPlaya
  3.  * I've tested this locally and it works for me
  4.  * the first part of the condional is if it's a view it will truncate it
  5.  * to 8 chars.
  6.  * Otherwise, it must be a full node view and displays it all.
  7.  *
  8.  */
  9.  
  10. <?php if ($page == 0) {
  11.     print substr($field_nikkis_notes[0]['value'], 0, 8);
  12.   } else {
  13.     print $field_nikkis_notes[0]['value'];
  14.   }
  15. ?>
  16.  
  17. /*
  18.  * The issue you had with $content can be rectified by breaking
  19.  * content into it's constituent chunks
  20.  * e.g $content[0]['value'] - or whatever chunks you need.
  21.  * I suspect it could you could be dealing with some quite heavily
  22.  * nested arrays in $content, but it's been a while since I did such
  23.  * work on it. Having said that, I'll be back on it in the next few
  24.  * days, as I'm taking over the maintenance of a complex D5
  25.  * site. Hence my enthusiasm for trying to help you with your
  26.  * problem - it's an opportunity to brush up on my skillz.
  27.  *
  28.  */

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.