Ship IB with own view templates
lgierth - October 15, 2009 - 16:43
| Project: | Image Browser |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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
| Attachment | Size |
|---|---|
| imagebrowser-bug-step-1.png | 18.87 KB |
| imagebrowser-bug-step-2.png | 64.94 KB |

#1
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
#2
#3
#4
Why exactly do you want to modify the template? Can the changes you want simply be made by CSS.
#5
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
#6
What templates does IB rely on which aren't part of IB?
#7
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
#8
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 :)
#9
I'll see what I can do, too :)
Edit: It's tricky, omg!
#10
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
#11
Isn't this solved with the new version? It ships with a template for the browse view.
#12
Hi scroogle,
you're wrong, it only ships with a template for the browse page.
Best regards,
Lars
#13
Ah, you're right, sorry. What about the theme overrides that Views offers?
#14
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
#15
Well, we can still reside to setting our own theme function in $view->display_handler->definition['theme'].
#16