I would like to customize the 'submitted by user' section of certain contact types and add a 'contact author' link.
1 Answer
You certainly shouldn't need to hack core for this. There's a few ways to do this, the simplest way is to customise node.tpl.php. For example if you were using the default node.tpl.php you would copy it to your theme folder, rename it "node--yourcontenttype.tpl.php" and then open it up and find the code:
<?php if ($display_submitted): ?>
<div class="submitted">
<?php print $submitted; ?>
</div>
<?php endif; ?>
You can then add the code to generate your contact link, something like this (untested):
<?php if ($display_submitted): ?>
<div class="submitted">
<?php print $submitted; ?>
<a class="user-contact" href="/user/<?php print $uid; ?>/contact">Contact</a>
</div>
<?php endif; ?>
-
2Some notes: use
l()
orurl()
; check if user has access to use contact form withuser_access('access user contact forms')
.– kalabroAug 13, 2012 at 17:29