3

Which links is Drupal referring to in 'print render($content['links']? 'Links' is kind of general to me so I am wondering which links this php snippet is referring to.

I've looked at Drupal's theming references and saw only a list of variables for theming.

1 Answer 1

2

The links it is referring to are the comment links, statistics links and translation links of a node.

So in a situation where you want just the comment links, it would be

print render($content['links']['comment']);

For more information, see this page.

https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_pre_render_links/7

1
  • Worth to remember that contributed modules can provide their own links, so just rendering all elements that are in $content['links'] now and not rendering $content['links'] themselves is a mistake if you are creating custom theme.
    – Mołot
    Commented Jul 9, 2013 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.