Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.9
Component:
General
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 May 2012 at 12:54 UTC
Updated:
4 May 2012 at 09:10 UTC
I am creating a content type for listing general information about local public libraries. One of the things I want to include is a "Powered by Drupal" icon. If in fact they are. My desire is to have a yes/no field in the create content page that if checked 'yes' the logo appears and obviously if 'no' then it does not.
Of course I've tried searching for a solution, but I'm having trouble choosing search terms that return relevant information.
Any ideas will be GREATLY appreciated.
Thanks,
TBG
Comments
Comment #1
anthonylindsay commentedOne possible solution would be to use a .tpl.php file for your content type and put logic in there.
So when your node loads it would test the value of your yes/no field and depending on the value of that, output the required image.
e.g. you could put this in a template file called node-mycontenttype.tpl.php, which would be basically a copy of node.tpl.php from your theme, or from your base theme, or core if it is not already in your theme.
You'll note from the docs on node.tpl.php that the template has access to the full node object, $node.
Comment #2
technobrarygeek commentedThanks Anthony,
I tried your solution. It kind of worked. It displayed the image in the field location I wanted, but broke everything else. lol
I have contemplate enabled for another module. I've tried to edit the template there but when I do it jsut shows the php for each field not the 'results'.
It appears I need to do some learnin' on contemplate. But, you pointed me in the right direction.
Thank you.
TBG
Comment #3
anthonylindsay commentedNo problem.
Marking resolved.