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
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

AttachmentSize
imagebrowser-bug-step-1.png18.87 KB
imagebrowser-bug-step-2.png64.94 KB

#1

lgierth - October 15, 2009 - 17:00
Category:bug report» 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

#2

lgierth - October 15, 2009 - 17:01
Category:task» feature request

#3

lgierth - October 15, 2009 - 17:04
Title:IB broken if view template modified» Ship IB with own view templates

#4

Starnox - October 15, 2009 - 21:59
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.

#5

lgierth - October 15, 2009 - 23:37
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

#6

Starnox - October 15, 2009 - 23:48

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

#7

lgierth - October 16, 2009 - 00:02

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

Starnox - October 16, 2009 - 00:09

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

lgierth - October 16, 2009 - 00:44

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

Edit: It's tricky, omg!

#10

lgierth - October 16, 2009 - 02:20

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

scroogie - November 1, 2009 - 13:25

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

#12

lgierth - November 1, 2009 - 16:22

Hi scroogle,

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

Best regards,
Lars

#13

scroogie - November 1, 2009 - 16:56

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

#14

lgierth - November 1, 2009 - 18:03

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

scroogie - November 1, 2009 - 18:52

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

#16

q0rban - November 23, 2009 - 13:15
Status:postponed (maintainer needs more info)» active
 
 

Drupal is a registered trademark of Dries Buytaert.