By drupallumina on
Hi
I'm not a php expert (as you will guess from the following)!
I've created a content type (landing page) and also a node-landing_page.tpl.php. All good so far.
The content type has an optional image file field.
What I want to be able to do is:
If editor chooses to upload an image show one piece of code.
Else If editor chooses not to upload an image show another piece of code.
The code I've written inside node-landing_page.tpl.php is:
<?php
// $Id: node.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $
?>
<?php if([WHAT GOES IN HERE?]): ?>
<div class="copy-and-image">
<div class="copy">
<h1><?= $node->title ?></h1>
<?= t($node->content['body']['#value']) ?>
</div>
<div class="image">
<?= $node->field_landing_image[0]['view'] ?>
</div>
</div>
<?php else: ?>
<div class="copy-no-image">
<div class="copy">
<h1><?= $node->title ?></h1>
<?= t($node->content['body']['#value']) ?>
</div>
</div>
<?php endif; ?>
See first line: <?php if([WHAT GOES IN HERE?]): ?>
Please excuse my ignorance if this is a deeply dumb question
cheers
Comments
Answer to my own post...
Ok figured it out:
Q:
A: