If Statment in Custom node template based in feild content existance I have a content type called specials

In that content type I have a field called discount code which has a machine name of field_discount_code

I have a custom node template called node--specials.tpl.php that I am using to fomate the display of this content type

If the discount code if filled in by the user I want drupal to show some text if it is left empty I want it show some other generic text

here is the code I am trying but not having any luck with

&lt;?php if (!empty($content['field_discount_code'])): ?&gt;

&lt;p&gt;Call &lt;strong&gt;1-800-661-2555&lt;/strong&gt; to contact our Guest Service specialists to reserve this package or book online by using discount code "&lt;strong&gt;&lt;?php print render($content['field_discount_code']);?&gt;&lt;/strong&gt;".&lt;/p&gt;

&lt;?php else: ?&gt;

&lt;p&gt;Call &lt;strong&gt;1-800-661-2555&lt;/strong&gt; to contact our Guest Service specialists to reserve this package.&lt;/p&gt;

&lt;?php endif; ?&gt;


If I leave the discount code empty drupal is still showing the first text chunk but with nothing in the render($content['field_discount_code']); area.

so like this 

Call 1-800-661-2555 to contact our Guest Service specialists to reserve this package or book online by using discount code "".

I have also tried 

&lt;?php if ($content['field_discount_code'] == "NONE"): ?&gt;

text to display here

&lt;?php else: ?&gt;

text to display here

&lt;?php endif; ?&gt; 


but no joy I am relatively new to drupal dev so perhaps I am doing this the wrong way any insight would be greatly appreciated!
That's weird, the first code works in my end. Are you sure the node--specials.tpl.php is being called in the first place? I am suspecting that maybe you're still using node.tpl.php though I'm not sure.

Try to print some text in your tpl file to check if it is being used by your content type.