It used to be so easy.
<?php print $fields['title']->content; ?>
...printed the title in a simple view template for rows. In something like views-view-fields--test.tpl.php.

In Drupal 7 and Views 3.5, this produces errors:
Undefined index: title in include()....etc.
Trying to get property of non-object in include()...etc.

...please, I'm not really a developer, what do I use instead of:
<?php print $fields['title']->content; ?>
?

Comments

merlinofchaos’s picture

Status: Active » Fixed

Nothing in how that template has changed, so there is something missing here.

First, are you sure you're using the right template? "Something like" views-view-fields--test.tpl.php may not actually be a variation of views-view-fields.tpl.php so we need to make sure.

Second, are you sure you have the correct field ID? Does the 'title' field actually exist as a field?

It might help to do this:

var_dump(array_keys($fields));

That will tell you what fields you actually have access to in the template. Perhaps that is enough information to help you proceed?

I'm going to mark this fixed, as i haven't any more advice to give, but if you need additional help, there might be more you can provide after you've answered the above questions. If so, mark this issue active again.

andrew smith’s picture

Thank you for the brilliant module and responding with the useful php.

My mistake was setting Title and other fields to 'Exclude from display' (bringing them into a Global Text field).
'Exclude from display' seems to exclude it from template as well, which I mention here just in case someone else makes the same mistake.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

typo