I'm just beginning to learn theming Drupal 7, and have encountered something I can't seem to find any info on (and my experiments have no effect).

In tao/rubik theme, and in many others there is the views-view-grid.tpl.php template which arranges the resulting items from a view in a grid design.

Now, at the very end, after splitting into rows and columns there is a print $item which is the section that prints the actual node content/teaser in the grid square. I'm assuming the content is a node, since this is what I set the view block to display, also I set it to display the full content of that single node.

However, no matter what I do, I can't seem to modify the template of this node... how should the template be called? should it be placed somewhere special?

What am I missing?

  • Not sure if it's just a typo in the question but in Drupal 7 the template naming convention would mean the file should be called views--view--grid.tpl.php – Clive Jun 28 '12 at 19:54
  • 1
    Did you click on "Rescan template files" in Views >> Style Information >> Theme:Information ? – Ajay Kotian Jun 28 '12 at 20:01
  • Hi, Copied the template name directly from the template folder. As to the Rescan, Yes I did... change to the Grid template did indeed have effect, but not on the $item which is another level in, I guess. – Moshe Eshel Jun 28 '12 at 20:03

If you are asking how to theme the display of a node, those templates have names like node.tpl.php, node--NID.tpl.php, node--TYPE.tpl.php, etc. Lots of information on templates can be found here

  • Also, in the view edit form, check for Advanced -> Other -> Theme: Information – Capi Etheriel Jun 29 '12 at 3:22
  • missed that single - ... now it works. how stupid of me. – Moshe Eshel Jun 29 '12 at 14:34
  • we've all been there; no one is stupid when it comes to missed dashes in drupal templates! – Jimajamma Jun 29 '12 at 14:43

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.