<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
My solution for now was to change node.tpl.php to have this at the top:<br>
<?php<br>
global $user;<br>
$approved_roles = array('superuser', 'editor'); <br>
?><br>
<br>
and in the header area:<br>
<?php if (is_array($user->roles)) {<br>
if (count(array_intersect($user->roles, $approved_roles)) > 0){
?><br>
<h2><a href="<?php print $node_url ?>"
title="<?php print $title ?>"><?php print $title
?></a></h2><br>
<?php }else{ ?><br>
<h2><?php print $title ?></h2><br>
<?php }} ?><br>
<br>
Thanks to the help on this list and the info on this page:
<a class="moz-txt-link-freetext" href="http://drupal.org/node/104444">http://drupal.org/node/104444</a><br>
<br>
Now if you're not an admin it doesn't link to the page, but if you are
it does so you can edit it. The only concern I really have about this
solution is maintenance - right now there are only the above listed
roles for admin editing. However if we add "manager", "content
producer" etc, then a change has to be made to node.tpl.php every time
that happens. That is of course not ideal for a single use template
like this and would be completely unworkable for a reusable template. <br>
<br>
Anyone know of a way to query whether the user has edit rights on the
node (no matter what their role) instead of whether they're in a
particular role? Then I could rewrite this in a way that is more
maintainable.<br>
<br>
thanks<br>
.sander<br>
<br>
<br>
sander-martijn wrote:
<blockquote cite="mid:46CB2706.1040000@sander-martijn.com" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
I'm using node.tpl.php to rewrite the content like this:<br>
<div><br>
<h2><?php print $title ?></h2><br>
<div class="content"><?php print $content ?></div><br>
</div><br>
<br>
So that I don't have the header link bc i don't want the content to
show anywhere other than the home page. Thanks everyone for giving me
several different options to try. At the moment, for my needs it seems
like the best option to get what i need would be to change node.tpl.php
so that it links the title like normal if you're an admin. Furthermore
I should probably only retheme stories until i get a better handle on
the different options.<br>
<br>
<br>
Metzler, David wrote:
<blockquote
cite="mid:25C3492D5925964585F542C770231C120262BDD7@oak.evergreen.edu"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.2900.2180" name="GENERATOR">
<div dir="ltr" align="left"><span class="078150715-21082007"><font
color="#0000ff" face="Arial" size="2">Last I checked, node Title was a
required field, and by default, the node title on a home page displays
with a link to that piece of content. So how are you suppressing them
for the two paragraphs. Are you using panels? Are you supressing the </font></span><span
class="078150715-21082007"><font color="#0000ff" face="Arial" size="2">the
titles via custom tpl's for specific node types (e.g. story.tpl)? Are
these blocks with custom text? Have you customized node.tpl, story.tpl
or another .tpl file to remove titles? </font></span></div>
<div dir="ltr" align="left"><span class="078150715-21082007"></span> </div>
<div dir="ltr" align="left"><span class="078150715-21082007"><font
color="#0000ff" face="Arial" size="2">As one person has suggested,
adding the edit link at the theming layer with tests on which "role" a
user is in, is one way to add specific links to editing a node on the
page. Could you include more info about how your paragraphs are
constructed? </font></span></div>
<div dir="ltr" align="left"><span class="078150715-21082007"><font
color="#0000ff" face="Arial" size="2"><br>
Dave</font></span></div>
<div dir="ltr" align="left"><span class="078150715-21082007"></span> </div>
<div dir="ltr" align="left"><span class="078150715-21082007"></span> </div>
<br>
</blockquote>
</blockquote>
</body>
</html>