By eviljoker7075 on
Hello. Ias it possible, to stop node headings appearing on a published node if there is no value submitted.
Here is a real life example on my site. On the page I have not submitted a 'least favourite track' or 'for fans of'. Can I make those headings not show up?
http://allcdreviews.com/node/4
Thank you
Comments
Use CSS?
Are you using contemplate? I think this would require some logic to detect if a value has been entered. If not, then just don't show that heading, or hide it using CSS.
ok, first of all what is
ok, first of all what is contemplate? I assume it's sme sort of module, if so, will it affect the template I already have installed?
Secondly where would I enter the logic statement?
theming
locate yout theme directory (it should contain 'page.tpl.php'). Create a 'template.php' file and in it put the following:
Will this totally override
Will this totally override the template field in the contemplate module? Because I am using that... is there some simple IF statement I could add to the template field in Administer>>content types>> templates?
An example field name I use is:
$field_for_fans_of
...
The solution I provided has nothing to do with the contemplate module. Using the contemplate module is another solution, and it has some drawbacks, e.g. you have to update the 'template' whenever you add fields to your content type, and you have to create a 'template' for each of your content types.
My solution looks more complicated, but IMHO it's actually the simpler and easier.
The other way around: contemplate overrides the function I gave you.