Active
Project:
Genesis
Version:
6.x-2.4
Component:
Genesis SUBTHEME
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2009 at 05:23 UTC
Updated:
10 Aug 2009 at 00:20 UTC
Hi
I am trying to restrict access to nodes so that only the author can view them.
I can hide the content easily,m but I can't figure out how to change the node title to, "Access Denied"
My node-contenttype.tpl.php is:
<?php
global $user;
if ($node->uid == $user->uid) { ?>
<div id="<?php print $node_id; ?>" class="<?php print $classes; ?>">
<div class="node-inner">
<?php if (!$page): ?>
<h2 class="node-title">
<a href="<?php print $node_url; ?>" rel="bookmark"><?php print $title; ?></a>
<?php print $unpublished; ?>
</h2>
<?php endif; ?>
<?php if ($submitted): ?>
<div class="node-submitted"><?php print $submitted; ?></div>
<?php endif; ?>
<?php print $picture; ?>
<div class="node-content"><?php print $content; ?></div>
<?php if ($terms): ?>
<div class="node-terms"><?php print $terms; ?></div>
<?php endif; ?>
<?php if ($links): ?>
<div class="node-links"><?php print $links; ?></div>
<?php endif; ?>
</div>
</div> <!-- /node -->
<?php
}
else {
$node->title = 'Access Denied';
$content = 'Sorry, you don\'t have permission to view this person\'s registration details.';
?>
<div id="<?php print $node_id; ?>" class="<?php print $classes; ?>">
<div class="node-inner">
<div class="node-content"><?php print $content; ?></div>
</div>
</div> <!-- /node -->
<?php } ?>
The $node->title value isn't working, the original title of the node is still displaying.
How do I change this?
Thanks
Glenn
Comments
Comment #1
glennnz commentedSOLVED
drupal_set_title('Access denied');