Hi,

today I noticed that Image Browser was broken as soon as I activated a theme with view templates. The modified template is views-view.tpl.php and in the case of IB's popup it only outputs $rows and some spaces, so that the relevant HTML looks like this:

<div id="browse">
  <div class="browse">
    <div class="item-list">
      <ul>
        ...
      </ul>
    </div>
  </div>
</div>

Screenshots of the broken popup are attached.

I didn't look deeper into the source code, but I think the problem could be that IB's CSS and JS selectors rely on the exact markup returned by the themed view.

For my individual case (I use the custom theme at the frontend only, at the backend I use Garland) I used admin_theme.module to make the theme engine use Garland on imagebrowser/* paths as a workaround.

Best regards,
Lars

Comments

lgierth’s picture

Category: bug » task

Hi again,

I just digged myself into the code and noticed that it's more or less senseles to apply CSS and JS to something whereof I don't know how it's structured. So why not simply ship matching views templates with IB? We could simply copy the default templates from views.module.

Best regards,
Lars

lgierth’s picture

Category: task » feature
lgierth’s picture

Title: IB broken if view template modified » Ship IB with own view templates
jdelaune’s picture

Status: Active » Postponed (maintainer needs more info)

Why exactly do you want to modify the template? Can the changes you want simply be made by CSS.

lgierth’s picture

Priority: Critical » Normal

Hi,

the production server of the site I'm building will have a very small traffic limit, so I cleaned up the templates (especially views') as much as possible.

But I think this is not the matter. IB comes with its own "theme" (HTML and CSS) and therefore should not use templates of another theme. Besides that I think it's problematic to rely on components on which IB itself has no influence.

Best regards,
Lars

jdelaune’s picture

What templates does IB rely on which aren't part of IB?

lgierth’s picture

Hi,

it relies on the templates that are used to build the view in the dialog's selection part. These are views-view.tpl.php and views-view-list.tpl.php.

Best regards,
Lars

jdelaune’s picture

Ok I'll see what I can do to remove the reliance on these but it's not at the top of my list. Patches welcome :)

lgierth’s picture

I'll see what I can do, too :)

Edit: It's tricky, omg!

lgierth’s picture

After some digging and digging (and digging) I found that the solution could be simple an elegant, but I didn't get it to work.

Support request at: #606046: Making a module override another module's template

scroogie’s picture

Isn't this solved with the new version? It ships with a template for the browse view.

lgierth’s picture

Hi scroogle,

you're wrong, it only ships with a template for the browse page.

Best regards,
Lars

scroogie’s picture

Ah, you're right, sorry. What about the theme overrides that Views offers?

lgierth’s picture

Yeah, I tried that alot, but it seems like theme overrides are only usable in themes, not in modules. My support request at #606046: Making a module override another module's template has not been answered yet.

Best regards,
Lars

scroogie’s picture

Well, we can still reside to setting our own theme function in $view->display_handler->definition['theme'].

q0rban’s picture

Status: Postponed (maintainer needs more info) » Active