I've configured my Tardis block to use the Accordion Year link style, but I'm not getting an accordion... On inspecting the generated html/css, I find:

<li class="tardis-link-year tardis-year-2015">
<h3>
<a href="javascript:void(0);">2015</a>
</h3>

What could be going wrong? Are there any prerequisites in the theme to enable this to work?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

atiras’s picture

Issue summary: View changes
atiras’s picture

Issue summary: View changes
luco’s picture

Category: Bug report » Support request

hello,

what do you get instead of an accordion? have you generated more than one TARDIS block?

please provide me all steps to reproduce the problem.

if you have a link to your live or testing website, that's super helpful.

marking as support request since it works as designed.

cheers,
Luciano

atiras’s picture

I have generated one tardis block and no tardis page (as I am using a Custom view). Theme is a paid-for theme based on Bootstrap3.

Tardis config is in attached file.

Development website isn't accessible, I'm afraid.

Instead of an accordion I get:

Monthly archive

luco’s picture

I don't get it. according to your settings, it was supposed to work.

try to change from accordion to normal or no link. save the settings, clear all caches, reload the page where the block is. then switch back to accordion. save the settings, clear all caches, reload the page where the block is.

also have you tried to change the theme? revert to Bartik and see what happens. paid themes sometimes approach things differently, which means they might have custom code that doesn't, well, play nice with Drupal's.

by the way, the code you pasted here looks different from the one output by the module.

I understand you've signed an NDA, but maybe you can create a sandbox environment without anything from your client's project, something like testing.yoursite.com. that ought to speed things up. ;)

cheers

atiras’s picture

1. I've changed the theme to Bartik and it works.
2. I've changed the theme to Bootstrap3 (the basic free version) and it doesn't work -- so it's some interaction with Bootstrap that's the problem, not with the paid theme, which should make it easier to investigate.
3. "try to change from accordion to normal or no link. save the settings, clear all caches, reload the page where the block is. then switch back to accordion. save the settings, clear all caches, reload the page where the block is. " -- doesn't help.

Problem with providing access to a devt environment isn't an NDA -- the devt environment is behind a firewall... and the paid theme is only under evaluation so can't be made live yet. If I can find time, I'll try to set up an accessible sandbox environment but it might not be for a few days...

luco’s picture

Status: Active » Postponed

I'm sorry, but I just don't have time to look into why a Bootstrap theme won't work right now. it is an interesting issue - and a bug nevertheless - but I can't promise a fix in the near future.

please try a different theme, like Zen or Omega. they have clean slate versions that make theming a website much easier.

or, if you find a solution, create a patch and I'll revise it.

cheers

atiras’s picture

Category: Support request » Bug report

I'm sticking with Bootstrap, and won't use this module. I have, however, changed this back to a bug report, which is how it started out. I also don't have time (or the skills) to try to fix it.

atiras’s picture

Title: Year accordion not working » Year accordion not working with Bootstrap theme
luco’s picture

Category: Bug report » Feature request
Status: Postponed » Active
Issue tags: +theming, +bootstrap

found it: Bootstrap doesn't print item-list DIVs, which are essential for TARDIS to work properly. such DIVs are a common Drupal element, which is why I chose to use them in the first place.

as I found out this is not a bug per se, but rather an improvement for TARDIS to be compatible with a greater range of themes.

therefore I'm working to improve my module. you're welcome.

next time, try to either be more involved or grateful (or both). there's module maintainers who'd've turned you down for less - and if you insisted, they'd report you.

atiras’s picture

I wasn't being ungrateful, or insisting on anything, just explaining why I won't be using the module, and why I can't help improve it. I put as much effort as you asked for into providing information to help diagnose what was happening -- even offered to spend time setting up a sandbox environment for you to access -- until you told me:

I'm sorry, but I just don't have time to look into why a Bootstrap theme won't work right now. it is an interesting issue - and a bug nevertheless - but I can't promise a fix in the near future.

It's great that you've subsequently identified what's happening, and intend to improve the module as a result. I look forward to trying it again when you've done so.

luco’s picture

FileSize
940 bytes

hello,

could you please test the attached file?

rename it to tardis.js and place it in the tardis/js folder - but back yours up first.

as soon as you report, I'll be able to mend the module and release a new version.

cheers

atiras’s picture

Ok -- this is on my todo list for this weekend.

atiras’s picture

I'm sorry -- I've tried the new file (including in a vanilla Bootstrap 3 environment) and I get the same behaviours as before. The html generated for the relevant block is:

 <aside class="col-sm-3" role="complementary">
          <div class="region region-sidebar-second">
    <section id="block-tardis-tardis-tardis" class="block block-tardis contextual-links-region clearfix">

        <h2 class="block-title">Monthly archive</h2>
    <div class="contextual-links-wrapper"><ul class="contextual-links"><li class="block-configure first last"><a href="/admin/structure/block/manage/tardis/tardis_tardis/configure?destination=archive/2014/03">Configure block</a></li>
</ul></div>
  <ul class="tardis tardis-list" id="tardis-accordion"><li class="tardis-link-year tardis-year-2015"><h3><a href="/archive/2015">2015</a></h3>
<ul><li class="tardis-link-month tardis-year-2015 tardis-month-01"><h4><a href="/archive/2015/01">January</a></h4>
</li>
</ul></li>
<li class="tardis-link-year tardis-year-2014"><h3><a href="/archive/2014">2014</a></h3>
<ul><li class="tardis-link-month tardis-year-2014 tardis-month-09"><h4><a href="/archive/2014/09">September</a></h4>
</li>
<li class="tardis-link-month tardis-year-2014 tardis-month-08"><h4><a href="/archive/2014/08">August</a></h4>
</li>
<li class="tardis-link-month tardis-year-2014 tardis-month-07"><h4><a href="/archive/2014/07">July</a></h4>
</li>
<li class="tardis-link-month tardis-year-2014 tardis-month-05"><h4><a href="/archive/2014/05">May</a></h4>
</li>
<li class="tardis-link-month tardis-year-2014 tardis-month-04"><h4><a href="/archive/2014/04">April</a></h4>
</li>
<li class="tardis-link-month tardis-year-2014 tardis-month-03"><h4><a href="/archive/2014/03" class="active">March</a></h4>
</li>
<li class="tardis-link-month tardis-year-2014 tardis-month-01"><h4><a href="/archive/2014/01">January</a></h4>
</li>
</ul></li>
<li class="tardis-link-year tardis-year-2013"><h3><a href="/archive/2013">2013</a></h3>
<ul><li class="tardis-link-month tardis-year-2013 tardis-month-09"><h4><a href="/archive/2013/09">September</a></h4>
</li>
</ul></li>
</ul>
</section>
  </div>
      </aside>  <!-- /#sidebar-second -->

What else can I tell you to help?

luco’s picture

thanks for testing!

the HTML hasn't changed, only the JS used to make the accordion effect.

please access yoursite.com/admin/config/development/performance and uncheck Aggregate JavaScript files (if it isn't already) then click Save configuration.

next, click Clear all caches at the top, but only if Aggregate JavaScript files is already unchecked.

if that doesn't work, access yoursite.com/sites/all/modules/tardis/js/tardis.js and see if it matches the JS I posted above.

cheers

atiras’s picture

Unaggregated Javascript files == no change
Cleared caches just in case == no change
.js file matches the one you provided

All the above done in a vanilla Bootstrap environment.

WebDeveloper InspectElement in Firefox gives me this for the jQuery :

function() {
  var $this = $(this);
  $this.siblings().find(".tardis-link-year").hide();
  $this.find(".tardis-link-year").addClass("active");
  $this.find(".tardis-link-year.active").show();
}

on this html line:

<li class="tardis-link-year tardis-year-2015"></li>

luco’s picture

ok, upon closer inspection of your HTML, I see that the links inside H3s don't have href="javascript:void(0);" like they were supposed to - instead, they have regular links to /archive/[year].

please re-check your TARDIS block settings. ;)

atiras’s picture

Hi -- my settings are still as they were at comment #4

luco’s picture

well, this is odd.

in your code from #4, H3s have href="void(0);" whereas in your HTML from #14, it's href="/archive/[year]".

please experiment with Year link style set to No link, Accordion and Normal link. show me the HTML output by each option, preferably in separate text files, and we'll proceed from there, ok?

cheers

atiras’s picture

OK -- busy today so it might not be until the weekend .

atiras’s picture

OK. I have double checked that I'm using your new version (from comment #12) and experimented with No link/normal link/accordion, all without js files aggregated. I recreated the block using the settings from #4 with one change: I'm now using a tardis page rather than a custom view (shouldn't make any difference but it eliminates one factor just in case).

Three text files attached...

luco’s picture

ok, the last version (tardis accordion html) has <h3><a href="javascript:void(0);">[year]</a></h3> as expected.

how does the block work in that case?

atiras’s picture

FileSize
21.11 KB

Alas, it doesn't function as an accordion. Same appearance as in comment #4.

luco’s picture

intriguing... I'll recruit some workmates to test in their PCs and report back.

meanwhile, if you could put up a temporary test environment that'd be very helpful. you could PM me the login info.

anyway thanks for your cooperation so far! :) we'll squish this bug.

atiras’s picture

Ok, I won't be able to set the sandbox up quickly as I'm run off my feet with other stuff at present -- will let you know when it's done but it might take a week or so -- sorry.

  • luco committed 1dc9555 on 7.x-2.x
    Issue #2409825 by atiras, luco: Fixed incompatibility with the Bootstrap...
luco’s picture

Status: Active » Fixed

hello,

I recruited some workmates and they tested my fix. everything went smoothly, but if you encounter this problem again feel free to create a new issue, ok?

thanks again for bringing this to my attention.

cheers

atiras’s picture

OK -- I still haven't had time to set up a sandbox.
Can you tell me which version of Bootstrap it's been tested with -- I'm using Bootstrap 7.x-3.1-beta2+2-dev.
Thanks
Helen

luco’s picture

Status: Fixed » Closed (fixed)

I tested with the latest stable, but that shouldn't be a problem.

cheers