Using panels and views for a news site

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
flahertypj's picture

Hi all,

My communications team would like a news type of site with main stories, images, and have it updated regularly. I've had good success with implementing a lot suggestions that i've found on the group but i'm having trouble over one issue. I'm hoping to use panels and then have views as blocks but can I theme these view blocks? I would full control over styling and theming the panel and all the view blocks but i don't know the best way to do this. I haven't found any good documentation on this.

Can i use template with block views? I would love to be able to do that since I do need to change the look of the view especially when it comes to adding CCK fields and removing things such as the title and replace with unique cck fields.

Thanks so much for your help

Patrick

Comments

Of course you can :)

jdidelet's picture

Hi Patrick,

Of course you can overwrite each block views. Click on "Theme: Information" at the end of Basic Setting box. You'll see every .tpl.php that you can create for overwrite the basic template.

Julien Didelet


Julien Didelet
Founder
Weblaa.com

re: Of course you can :)

flahertypj's picture

Thanks Julien for the response. What's the direct link to the theme information and what is block views file format ???-???.tpl.php? Thanks so much,
Patrick

See the picture in attachement

jdidelet's picture

I send you a screenshot for exemple with this comment. And yes. the file format is xxx.tpl.php. You'll find more information if you install advanced help module http://drupal.org/project/advanced_help and click on http://yourwebsite.com/help/views/style. :).

Julien Didelet


Julien Didelet
Founder
Weblaa.com

Sorry, I should have pointed

flahertypj's picture

Sorry, I should have pointed out that i'm running drupal 5 so I don't belive it has that screen.

So if i have a view called mainstory, the template I need is views-view--mainstory.tpl.php.

Thanks

ah ok

jdidelet's picture

Ok no problem. Of course the picture is for D6. Sorry.

Julien Didelet


Julien Didelet
Founder
Weblaa.com

*_*

beautifulmind's picture

For 5.x, you need to do the same thing as Mr. Julien explained. Its just that you won't get any help/feedback from the views interface about your overriding tpl.php

You have to clear the site cache as well as theme cache and views cache several times, I guess, then, views can identify your tpl.php.

I hope you will do this.

Regards
:)
Beautifulmind

Thank you kindly, but I just

flahertypj's picture

Thank you kindly, but I just want to confirm that the template format for views is "views-view--[insert view here].tpl.php" and I don't need to call it in template.php. Sorry about these questions for i'm really finding no information on views and templates especially ones in a panel block.

Thanks again for your help,

Patrick

template.php

yelvington's picture

In D5 I believe you have to do a bit of template.php work in order to get your view template recognized. Here is a decent tutorial:
http://zugec.com/drupal/theme-wizard-in-views-with-drupal-5

Newspapers on Drupal

Group organizers

Group categories

Topics - Newspaper on Drupal

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: