Closed (fixed)
Project:
Content Templates (Contemplate)
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Mar 2007 at 15:27 UTC
Updated:
5 Sep 2007 at 02:51 UTC
I made a seperate teaser text field for my CCK, and I want it to print teaser if there is a teaser, but if the story is short and no need for a teaser, it will print whole body of story. What code should I use? I figure it would use if ... else ... , but I'm not a coder so I need your help. Thanks in advance.
Comments
Comment #1
mhd commentedthis is what I have so far, but it print out the whole body, without the teaser
Comment #2
JonSTeps commentedI ran into the same issue and i put this together, I stink at php, so it's probably not the best code but it works for me.
if($field_teaser[0]['value']):print check_plain($node->field_teaser[0]['value'])else:print $node->teaserendif;Comment #3
(not verified) commented