By ginga8 on
I am trying to add the link to my comments on a node template that I am creating. I have the following.
<!--- <?php
$title = $node->links['comment_add']['title']; // Share your thoughts and opinions related to this posting.
$URL = $node->links['comment_add']['href'];// comment/reply/59
?>
<?php l("$title", "$URL", array('absolute' => TRUE));?>
I get nothing returned when the page is rendered.
Can someone help me.
Thanks
Comments
Your example starts with
Your example starts with
<!---, an html comment, which means what ever is in the comment does not display.Also a side note there is no need to quote $title and $URL when passing them to a function.
OOPS
Should have cleaned up my code a little before I sent it. I was in a rush
This the code and it is still not displaying anything
Try adding <pre><?php print
Try adding
at the end of your node template file to see what node actually contains.
Output
I did what you suggest and these are available
Duh?
This
should be
(notice the print statement)
OMG
I can't believe the amount of time I spent trying to figure that out.
Sometimes it is the simplest things you overlook
Thanks so much, it is working now.
One more quick question
This is the link that I am now outputting
Why would it only be available when I am logged in. when I am not logged into the website, the link disappears.
That would suggest you have
That would suggest you have not granted people who are not logged in permission to post comments.