How to set a view title from page title dynamically, as if the page node title is About the Company I want the corresponding view title to be the same as node title.

any suggestions

  • Are you talking about a views block that is displayed on the same page as your node? – deinqwertz Aug 19 '13 at 9:24
  • Are you using the view as page or block? – rreiss Aug 19 '13 at 9:24
  • No it is not on the same page, I am using a view block for a page or lets say for a node of a content type in another page such as main page. – fadifannoun Aug 19 '13 at 10:18

Hope this will help you.

In Drupal 7 you can use VIEWS CONTEXTUAL FILTER for your requirement


  • Add VIEWS contextual filter for node ID

    Contextual filter for node ID item

  • Contextual filter settings for node ID

    • Provide the default argument from the URL

    • Also override the TITLE and the BREADCRUMB

    Contextual filter settings for node ID

  • Open browser and type Base_url/view_path/NODE_ID you can see both the TITLE and the BREADCRUMB will be changed based on the NODE ID.

  • Good idea but if one doesnt want the filter to limit results, they can select Global:Null filter. That filter doesnt filter results. – Sinan Erdem Oct 3 '17 at 14:27

You should use the THEME_preprocess_page(&$vars) function in your theme's template.php

  • 1
    Could you please elaborate a bit more on how to use this hook for desired effect? – Mołot Aug 19 '13 at 9:23

From the Context part of the panel page pick out %node:title and put it in the settings of the view.

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.