Hey all,
none of the modules that uses jquery cycle (views slideshow, views rotator, rotor,..) is working for me when i embed the block in my custom theme.

<?php
$block = module_invoke('views', 'block', 'view', 'banner-block_1');
print $block['content'];
?>

But it's working perfectly when using garland theme for example.
Any help is appreciated.
Thanks in advance

Comments

coreyp_1’s picture

Were you sure to add the $closure variable to the bottom of your page.tpl.php?

-Corey

rabihs’s picture

Hey coreyp_1,

I'm adding the $closure before the body closing tag

<?php print $closure ?>
</body>

what else can be wrong?

coreyp_1’s picture

try comparing the HTML output by Garland as opposed to your theme. Are there any obvious differences in the HEAD section? For that matter, do you also have all the necessary variables in that section, too? You can always compare the Garland page.tpl.php with your custom one to see what may have been omitted.

-Corey

rabihs’s picture

Hey coreyp_1,
sorry for the late reply, well I copied and pasted the garland page.tpl.php file and worked directly on it without styling and I noticed that if I add it from the block section in the admin it works perfectly, but if I add it by code it's not working. Is there any steps that I should be doing or something?

coreyp_1’s picture

Let's take a step back.

So, is your PHP command producing HTML output? At this point, I assume that it is, it is just that the jquery cycle plugins aren't working.

Do you see any javascript errors?

Do you have a demo link?

At this point, my hunch is that, because you're not theming the block, then there's not enough HTML generated so the cycle plugin can work appropriately. In other words, the proper ID's and CLASSes aren't being generated.

-Corey

rabihs’s picture

Hey Corey,

Sorry for the late reply, I was away for the weekend. Thanks for your help.
I"m not getting any javascript errors, as for the demo link i'm working on my machine.
I copied garland's page.tpl.php and called the block at the end of container div. Here''s what i'm getting from the page source:

For drupal generated block:

<div class="view view-equipe view-id-equipe view-display-id-block_1 view-dom-id-1">
<div class="views-admin-links views-hide">
<ul class="links"><li class="0 first"><a href="/drupal-fr/admin/build/views/edit/equipe?destination=admin%2Fbuild%2Fblock#views-tab-block_1">Edit</a></li>
<li class="1"><a href="/drupal-fr/admin/build/views/export/equipe">Export</a></li>
<li class="2 last"><a href="/drupal-fr/admin/build/views/clone/equipe">Clone</a></li>
</ul> </div>
<div class="view-content">
<div id="views_slideshow_main_1" class="views_slideshow_main">
  <div id="views_slideshow_teaser_section_1" class="views_slideshow_teaser_section">
  <div id="views_slideshow_div_1_0" >
  <div class="views-field-title">
  <span class="field-content">Drupal</span>
  </div>
  </div><!--close views_slideshow_div_1_0-->
  <div id="views_slideshow_div_1_1" class="views_slideshow_hidden">
    <div class="views-field-title">
    <span class="field-content">La programmation</span>
  </div>
  </div><!--close views_slideshow_div_1_1-->
</div><!--close views_slideshow_no_display-->
</div><!--close views_slideshow_main_1-->
    </div>
</div>

For the block code I add directly in the page.tpl.php:

<div id="block-views-equipe-block_1" class="block block-views">
  <div class="content">
    <div class="view view-equipe view-id-equipe view-display-id-block_1 view-dom-id-1">
      <div class="views-admin-links views-hide">
      <ul class="links"><li class="0 first"><a href="/drupal-fr/admin/build/views/edit/equipe?destination=admin%2Fbuild%2Fblock#views-tab-block_1">Edit</a></li>
<li class="1"><a href="/drupal-fr/admin/build/views/export/equipe">Export</a></li>
<li class="2 last"><a href="/drupal-fr/admin/build/views/clone/equipe">Clone</a></li>
</ul></div>
<div class="view-content">
<div id="views_slideshow_main_1" class="views_slideshow_main">
  <div id="views_slideshow_teaser_section_1" class="views_slideshow_teaser_section">
  <div id="views_slideshow_div_1_0" >
  <div class="views-field-title">
  <span class="field-content">Drupal</span>
  </div>
  </div><!--close views_slideshow_div_1_0-->
  <div id="views_slideshow_div_1_1" class="views_slideshow_hidden">   
  <div class="views-field-title">
  <span class="field-content">La programmation</span>
  </div>
  </div><!--close views_slideshow_div_1_1-->
</div><!--close views_slideshow_no_display-->
</div><!--close views_slideshow_main_1-->
</div>
</div></div>
</div>

Thanks again for your help Corey

coreyp_1’s picture

I need to see what javascript command is being called. Look for a line that includes $('something here').cycle(more stuff here);

-Corey