Thank you for posting that it could be just the thing to give inspiration to someone who needs it! Keep up the great work! ulta free birthday gift
Remove/hide "Add New Comment" link for authorized / logged in / authenticated / registered users on Drupal 7 pages (full nodes).
I'm attempting to theme / style the node $links. This is apparently notoriously difficult to do. Even splitting up the $links elements is tough. It's pretty much an all-or-nothing situation. Anyway...
I moved the "new comment" textbox right up under the page content (above the comments) (see screenshot). This makes the "Add New Comment" link redundant for logged-in users because the textbox is right underneath it (instead of being way at the bottom of the page out of sight). Anonymous users should still see the "Log in or register to post comments" link.
I've played around with custom modules and template overrides but then I thought it could be as simple as something like below...
In node-tpl.php...
global $user;
if ($user->uid) {
hide($content['links']['#links']['comment_add']);
}
Or something like (also in node-tpl.php)...
<?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['links']['#links']['comment_add']);
?>
</div>
<?php print render($content['links']['#links']['comment_add']); ?>
<?php print render($content['links']['#links']['statistics_counter']); ?>
<?php print render($content['comments']); ?>
?>
So far I haven't been able to get anything to work.
Any help or suggestions would be much appreciated...
Fixed
11.1 🔥
node system
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Thank you for posting that it could be just the thing to give inspiration to someone who needs it! Keep up the great work! ulta free birthday gift