0

I use panels to display block with node title on a custom position. My question is about performance - what is faster - to use following php code inside block

<?php
$node = menu_get_object(); print $node->title;
?>

or to use use views to get title of current node. Thank you

1

Personally, I don't worry about performance of little things like this.

You also don't need to resort to Views to get this information.

If you are using the Node template page from Page Manager, then you can

  • edit the page
  • select the variant
  • edit the content
  • click the gear on the panel you want to Add Content
  • click the Node tab
  • click Node Title

This will then be a normal panel pane that you can place as you need it. This is one trick to get node content above the page title on complicated layouts.

  • Thank you, I know about this solution but that doe's not do the trick for me - it is rendered without h1 tags and "title" displays above no matter what. – loparr Jan 4 '14 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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