I'm trying to theme the jCarousel, but I'm having a hard time getting it the way I want. I decided to strip the view template files from all unneeded tags, so I went to the views theme information and this is what i saw:

Style output: viewscarousel-view.tpl.php (File not found, in folder sites/all/modules/viewscarousel/),

Is there supposed to be a template file like that? It is not in the package I downloaded.

Thanks in advance!

Comments

robloach’s picture

Clear your theme cache?

libeco’s picture

Did that, I also have
drupal_rebuild_theme_registry();
in my template.php while doing local work on the theme.

I have never looked at the code of a views plugin before, but when I looked at viewscarousel.views.inc I saw this line:

'theme' => 'viewscarousel_view',

I temporarily commented it out and saw the error was gone, there were no names for the template suggestions though so it really seems like the file viewscarousel-view.tpl.php is missing from the module package. (It just is not there.)

Thanks in advance!

friolator’s picture

I just noticed this today as well... exactly the same error.

bengtan’s picture

There is definitely some sort of bug here.

The file viewscarousel-view.tpl.php used to exist in this module (see http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/viewscarous...), but then it got removed as part of the commit for http://drupal.org/cvs?commit=193996, yet Views still asks for it in 'Theme: Information'.

bengtan’s picture

On the other hand, this is what views_theme() generates for hook_theme() on behalf of viewscarousel.module:

    [viewscarousel_view] => Array
        (
            [pattern] => viewscarousel_view__
            [file] => viewscarousel.views.inc
            [path] => sites/all/modules/viewscarousel
            [arguments] => Array
                (
                    [view] => 
                    [options] => 
                    [rows] => 
                    [title] => 
                )

        )

This declaration is for a theme('viewscarousel_view', ...) type function, not one based on template (ie .tpl.php) files.

So, one diagnosis is that Views correctly understands that there isn't a viewscarousel-view.tpl.php file, yet the "Theme: Information" link in views editing is incorrectly attempting to find it.

My opinion is that this is a small bug in Views, but I'm happy to be corrected by others.

bredi’s picture

same here. my theming of a view stopped working today and I get this error too.

subscribe

dgastudio’s picture

so any solution?

selinav’s picture

Hello,

I've donwloaded the tpl.php but the carousel doesn't work with it.
I wish to insert class in the li. How can I do it?

pschopf’s picture

selinav: You can put a custom version of views-view-fields.tpl.php file in your theme directory. This template formats all the content that goes inside each

  • . Copy views-view-fields.tpl.php from the views module's theme directory to your theme and rename according to the way the the view's "Theme: Information" shows you.

    Then you can simply wrap the entire output in '

    ' and then use a CSS selector for "... li .my-class" :
      <div class="my-class">
        <?php foreach ($fields . . .
          . . .  [the rest of the standard template]
        <?php endforeach ?>
      </div>
    
  • selinav’s picture

    Thanks for your reply. I've success to add the class, but the problem come from the carousel. Problem with FF, the ul generated is too short of 1px, the last image goes on the next line.

    AdrianB’s picture

    Using Views carousel 6.x-2.x-dev (2009-Nov-06) I get this error as well. Cleared cache but the error is still there.

    The file viewscarousel-view.tpl.php does exist in 6.x-1.x-dev but not in 6.x-2.x-dev.

    quicksketch’s picture

    This is because Views makes the assumption that all theming is done in template files. In the 2.x version, viewscarousel-view.tpl.php does not exist but there is a theme_viewscarousel_view() function in the module file, which takes the place of the file. The View Carousel handler CAN implement the theme_functions() method in its views handler and specify a different theme function name, which might be a good idea. That would prevent Views from looking for the normal locations. Either that or it could implement hook_theme_registry_alter() and remove the template registration that is added by Views.

    Either way, it's a cosmetic problem and it doesn't actually affect the use of the module.

    clemens.tolboom’s picture

    Maybe a bug report into the views project would help novice users. And it saves some more comments on this one :)

    Not sure how to report this myself.

    andrew.eatherington@gmail.com’s picture

    Just got this error yesterday. Carousel fell apart all of a sudden.
    Views reports missing viewscarousel-view.tpl.php.
    Removed module and re-installed - still the same.
    Checked the style options in views and see the custom css path is not available any more

    traviscarden’s picture

    Subscribing.

    zorax’s picture

    subcribing.
    I get the file views-view-fields.tpl.php from the view module.
    I just raname it according to the view style information here is the warning :

    warning: Invalid argument supplied for foreach() in D:\Almede_studio\wamp\www\test\sites\default\themes\escapades\viewscarousel-view--agenda--block.tpl.php on line 22.

    stevegmag’s picture

    Title: Style output: viewscarousel-view.tpl.php (File not found, in folder sites/all/modules/viewscarousel/), » subscribing

    I can get the override working by placing viewscarousel-view.tpl.php in my theme directory. However, I need to have several carousels available, each with a different override tpl file. How should these be named to get them to pull based on the view being used?

    viewscarousel-view-view1.tpl.php
    viewscarousel-view-view2.tpl.php

    I've tried every combination I can think of...

    thanks in advance.
    sg

    stevegmag’s picture

    Title: subscribing » viewscarousel-view.tpl.php (File not found, in folder sites/all/modules/viewscarousel/),

    Sorry didn't mean to change the thread title.

    anni’s picture

    It works with viewscarousel-view--myView.tpl.php

    anni’s picture

    Issue summary: View changes
    Status: Active » Closed (works as designed)