It would be extremely useful to be able to put more than one views showcase on a page. When I try two they both stop working.

Any workarounds?

Thanks

Comments

darkdim’s picture

I have the same problem. How can it be solved?

garywiz’s picture

This isn't an easy fix.

There are two problems:

  • The code in template_preprocess_views_showcase_view() does a drupal_add_js() for each instance. This requires significant modification to create settings per-instance. One workaround is to create a static variable and omit the settings except on the first execution.
  • The code in views_showcase.js searches globally for instances of tags instead of creating element-relative references. Fixing this is not easy and requires a lot of JQuery knowledge.

I have successfully gotten the module to work with multiple showcase views by making the above changes. Maybe when I get a chance over the next week I can post some examples. However, the first problem (per-view settings) is harder to solve and I may not bother, since I don't need per-view settings.

benjamin_dk’s picture

subscribing

miro_dietiker’s picture

You need to store the views settings in the drupal settings js variable. Switching to a per-instance settings container is straight forward.
We can use then a jquery .each to cycle through all views showcase instances and use the id of the showcase to address the corresponding settings in the drupal settings js.

You're right, this leads to some rewrite but also it would make the code much more clean.

drupal-user23’s picture

Is there any chance you still have links to the demos of the multiple showcases running on the one page? Thanks

aze2010’s picture

subscribing :(