Reply to comment
Alterations to the See Also field
Submitted by matt on Sat, 08/08/2009 - 16:45I like how the see also box is working / looking but want more choices when writing something.
I've added a single line text field to allow for the header text which before was hard coded into the tpl file to 'See Also' , and added a full text field to display below the links within the same div to allow for a short text blurb and perhaps any external links which aren't possible in the node reference field. ( I might add one above or perhaps some sort of flag to choose where the text appears, either above or below the links)
I also added a fieldset to tie all of these elements into the content entry form.

Now in my node-my_type.tpl.php
(Just the main div area)
<div class="content clear-block">
<?php
if ($page != 0){
$see_also_count = count($node->field_see_also);
if ($see_also_count>0 && strlen($node->field_see_also[0]['view'])>0){
if (strlen($node->field_see_also_header[0]['view'])>0){
print '<div class="seealso"><h3>' . $node->field_see_also_header[0]['view'] . '</h3><ul>';
}else{
print '<div class="seealso"><h3>See Also</h3><ul>';
}
foreach ($node->field_see_also as $see_also){
echo '<li>' . $see_also['view'] . '</li>';
}
print '</ul>';
if (strlen($node->field_see_also_footer[0]['view'])>0){
print $node->field_see_also_footer[0]['view'];
}
print '</div>';
}
}
?>
<?php print $node->content['body']['#value']; ?>
</div>
