I have a drupal 6 site on production server.

There is a blog, which has view setuped to display list of blog entries, but the default layout is broken. I have two options to proceed:

  • adjust styling on existing default template
  • create views-view-blog-tpl.php and add my custom layout there

So I choose option two and added a views-view-blog-tpl.php, upload it via ftp, on Edit View page I re-scan template files and Drupal successfully finds my template. Then I flush all caches and reload my view page - but no changes are show up. It's still showing me default view template with broken layout.

Is there something that I missed? Any additional step to make changes in my blog view template to show up?

Any help appreciated.

  • make sure you are setting the template on the right theme, eg, if you have an admin theme that is being used for the views admin page, make sure you are setting the template to the theme that will be presenting the blog page itself. – Jimajamma Mar 13 '13 at 15:15
  • selected theme is correct one (custom for my site), and as I mention, my custom blog template being successfully re-scaned and recognized by drupal. maybe you can point me to another direction: how can I add specific class name to default template (just for this blog view) so I can style it in css? thanks! – Eugene Pavlov Mar 13 '13 at 15:42
  • 1
    Free thinking, the only other suggestion if your view is named 'blog' is that it probably should be named views-view--blog.tpl.php if you are trying to override Views' Display output. But, once again, if Views is picking up your file on rescan, probably just a typo here. Otherwise, you can add a css class to the view right from the Views UI, at least in Views 3 anyway. – Jimajamma Mar 13 '13 at 16:37
  • the file name is okay: views-view--blog.tpl.php (just misspell it). how can I add css class to view? – Eugene Pavlov Mar 13 '13 at 19:25
  • 1
    If however there isn't a way, you might be able to cascade it down by using another class or id based off the page's body classes or other parent divs. – Jimajamma Mar 13 '13 at 19:52

Your Answer

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

Browse other questions tagged or ask your own question.