By halloffame on
I have themed my Views. Copied the template into my theme folder. But the problem is all the Views on my site got affected. I only want a certain view to appear differently. How will I rename the template so that it will only affect certain view and not all the Views on my site?
Comments
...
A view has a name. Say you named you view 'charlee'.
You need to embed this name in the template filename. Say your template file is 'views-view.tpl.php'. You need to rename it to 'views-view--charlee.tpl.php'.
(The naming rules aren't arbitrary. Views UI can help you here: there's a 'Theming information' link in the view's editing screen that lists all possible names for your template files. Each with a different level of specificness.)
I've also found the views
I've also found the views theming wizard to be helpful with theming individual views.
I don't have a theming
I don't have a theming wizard with Views. It's not in the module page either (to enable). I don't know but does it have to do with the version of Drupal/Views that I'm using? D6.2. Views 2.0-beta3.
This makes me all the more frustrated because all the documentation and tutorials on the site involves theming wizard.
Anyway, I tried renaming the templates as per mooffie's instruction (which what I've been doing anyway). The problem I keep on getting here is that when I rename the template the table/list views disappears.
You see what I'm trying to do here is to put one static image to my custom view so that at least it will look better. I was able to do it perfectly by editing the 'views-view.tpl.php'. However, however... When I rename the php template to 'views-view--mycustomview.tpl.php' (since I only want to do this with a certain view and not all the views on my site) the only thing that appears in the view block is the image and I can't see the view list/table anymore!!!
...
Most probabaly because you didn't clear Drupal's cache. You must do that for Drupal to notice the new template file. Drupal keeps looking for the old template file, and since you effectively deleted it, Drupal shows nothing instead.
The Themeing Wizard came with Views 1.x. Themeing is D5 was hard, so an aid was needed. However, since D6 --and Views 2.x-- makes theming so easy, a wizard is not needed.
The problem I was having was
The problem I was having was with Drupal core. I needed to apply some patch in order to solve my problem.
What patch did you use?
Hi there,
I'm currently having the same problem, and losing my "view" when I put the relevant template into my template directory.
What patch did you need to apply to get it working?
Many thanks!
This is the patch -
This is the patch - http://drupal.org/node/241570
...
Whatever patch you apply, remember to also clear the theme registry. A feature of mine, that makes life a bit easier, has just been commited to Views. I hope another one gets commited too.
.... double post....
Use Active Template. Using
Use Active Template. Using Active Template, your template(s) are actually integrated into the view itself. Active Template is similar to ConTemplate except that it applies to views. Active Template also allows you to include JavaScript/jQuery and CSS into your template too. As long as you can use ConTemplate, you can use Active Template.
Active Template is only for D5 at the moment, however if people show interest, we may be inclined to get a version for D6 out soon.
Best regards, Derek
http://collectivecolors.com