Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7529345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:38:14+00:00 2026-05-30T04:38:14+00:00

I have the following php code in my view using the Global: PHP field

  • 0

I have the following php code in my view using the Global: PHP field

<?php
drupal_set_title($row->title);
?>

I have the title field before the php in the order.

I’m sure this used to work but isn’t now… any ideas why. I need this in views as I’m getting the title of the content in loading (Based on contextual filters) and I want it to be the page title.

If this is no go… is there another way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:38:15+00:00Added an answer on May 30, 2026 at 4:38 am

    Not sure if this is a bug or not, but I was doing something similar and tried using drupal_set_title() in a hook_preprocess_views_view(), with no luck. I ended up doing this instead which did work for me.

    <?php
    function my_module_preprocess_views_view(&$vars) {
      // My view
      if ($vars['view']->name == 'my_view') {
        // Code to dynamically set title here...
    
        // Override view's title, drupal_set_title() was no longer working
        // it didn't work in views Global block either.
        $vars['view']->build_info['title'] = $my_title;
      }
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code for my login view: <?php echo $session->flash('auth'); echo $this->Form->create('User',
I have following PHP code $val=<div id=user.$row['cid']. userid=.$row['cid']. class=innertxt><img src=images/images.jpg width=50 height=50><strong>.$uname.</strong><ul> <li>Email: .$row['cemail'].</li>
I have the following code: if (include_once(dirname(__FILE__).'/file.php') || include_once(dirname(__FILE__).'/local/file.php') ) { This causes an
I am using zend framework... so I have the following code in display.php: <?php
i have following captcha code: <?php class CaptchaView extends View { private $fontsDir =
I have the following code : <?php $i = 0; foreach($this->list as $l) {
I have the following php code, which has been snipped for brevity. I am
I have the following PHP code which works out the possible combinations from a
I have the following PHP code doing a very simple select into a table.
I have a line of PHP code that does the following: $xml = <xml><request>...[snipped

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.