By miles28 on
Hi
I want to give a node template (using Content templates) two options.
The node has 3 cck fields:
-image
-link
-file
<a href="<?php print $node->field_enlace[0]['url'] ?>"><?php print $node->field_imagen[0]['view'] ?></a>
will show an image linking to an url
<a href="<?php print $node->field_archivo[0]['filepath'] ?>"><?php print $node->field_imagen[0]['view'] ?></a>
will show an image linking to an uploaded file.
Ok, but how could combine these two options, depending if use a link or uploaded file.
I'm looking for something like:
If an link is given, the use:
<a href="<?php print $node->field_enlace[0]['url'] ?>"><?php print $node->field_imagen[0]['view'] ?></a>
but if an uploaded file is given, the use:
<a href="<?php print $node->field_archivo[0]['filepath'] ?>"><?php print $node->field_imagen[0]['view'] ?></a>
Thanks in advance.