New CCK Module: CCK - Enable/Disable Node Link

pegleglax - January 18, 2008 - 05:21

This is merely an idea. What if we (I - or someone more knowledgeable) developed a simple CCK field that either enabled or disabled a node's link, so that the end user could not view the full node by clicking on the teaser.

How would I jimmy-rig this? Create a CCK field with 2 radio buttons... TRUE and FALSE. If FALSE is checked an IF statement would fail in node.tpl.php and the link would not be written. Example:

<h2 class="title"> <?php if (displayNodeLink == True); ?><a href="<?php print $node_url; ?>"> <?php endif; ?> <?php print $title; ?> <?php if (displayNodeLink == True); ?></a><?php endif; ?></h2>

Of course this rig may require the use of Contemplate to pass the variable?

PLEASE... all thoughts are welcomed!

 
 

Drupal is a registered trademark of Dries Buytaert.