In an attempt to manage how search results are displayed I've customized search-result.tpl.php to display the fields that I want of my custom content type and in the exact way I want each result to look. I've also customized node.tpl.php to, among other things, not print out $content. That's because I want to control what users see when they view a node. It seems that $content contains all of the fields of my node.
When I remove the printing of $comment I get the unpleasant side effect that the output of php code doesn't display. So, if I create a node and put phpinfo() in the node then I get no output if $content is not printed and the expected output if $content is printed.
Is there a way to get around this problem other than parsing the $content string and trying to figure out if it's the contents of a node or the output of some php code?
Thanks in advance.
Comments
It depends on what you don't
It depends on what you don't want to print. If they are CCK fields, there are display settings for each content type where you can exclude the field.
You can also use $node->content to print the pieces separately.
I'm embarrassed to say I
I'm embarrassed to say I didn't notice the ability to exclude display of CCK. I see it now. Thank you!
It turns out that I don't want to display the body of my nodes either and that the body field doesn't allow display exclusion. If no one has a better idea I'll add a second body field, exclude it from display and re-import my content to use that CCK field instead of the default body field. Then I can leave displaying of content on and php output should display.