Active
Project:
Image Browser
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Oct 2009 at 16:43 UTC
Updated:
23 Nov 2009 at 13:15 UTC
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
| Comment | File | Size | Author |
|---|---|---|---|
| imagebrowser-bug-step-2.png | 64.94 KB | lgierth | |
| imagebrowser-bug-step-1.png | 18.87 KB | lgierth |
Comments
Comment #1
lgierth commentedHi 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
Comment #2
lgierth commentedComment #3
lgierth commentedComment #4
jdelaune commentedWhy exactly do you want to modify the template? Can the changes you want simply be made by CSS.
Comment #5
lgierth commentedHi,
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
Comment #6
jdelaune commentedWhat templates does IB rely on which aren't part of IB?
Comment #7
lgierth commentedHi,
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
Comment #8
jdelaune commentedOk 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 :)
Comment #9
lgierth commentedI'll see what I can do, too :)
Edit: It's tricky, omg!
Comment #10
lgierth commentedAfter 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
Comment #11
scroogie commentedIsn't this solved with the new version? It ships with a template for the browse view.
Comment #12
lgierth commentedHi scroogle,
you're wrong, it only ships with a template for the browse page.
Best regards,
Lars
Comment #13
scroogie commentedAh, you're right, sorry. What about the theme overrides that Views offers?
Comment #14
lgierth commentedYeah, 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
Comment #15
scroogie commentedWell, we can still reside to setting our own theme function in $view->display_handler->definition['theme'].
Comment #16
q0rban commented