TOPIC: Vina Article Accordion

Vina Article Accordion 9 years 8 months ago #1150

  • David Schwittek
  • David Schwittek's Avatar
  • OFFLINE
  • New Member
  • Posts: 3
  • Orders: 0
  • Download: 1
  • Karma: 0
I was able to solve this problem by manually loading jQuery in the template. In short, when I was loading these via loadposition or loadmodule, the module's JavaScript calls were being made prior to jQuery being loaded the html was being rendered but the interaction code was returning an undefined. To correct for this, I moved the jQuery loading script in my template up to the very top, just after the <head> tag to ensure it loads first before any other JavaScript or jQuery calls are made.
Hope this helps!
The administrator has disabled public write access.

Vina Article Accordion 9 years 8 months ago #1151

  • Mette Staerk
  • Mette Staerk's Avatar
  • OFFLINE
  • New Member
  • Posts: 4
  • Orders: 0
  • Download: 1
  • Karma: 0
@ David
Thank you. But I have no idea, where to find the "jQuery loading script" in the template.

The word "jquery" appears several times in the index.php. What does it more precise look like?
My javascript knowledge is very small. :unsure:
The administrator has disabled public write access.

Vina Article Accordion via loadposition, loadmodule, or Modules Anywhe 9 years 8 months ago #1153

  • David Schwittek
  • David Schwittek's Avatar
  • OFFLINE
  • New Member
  • Posts: 3
  • Orders: 0
  • Download: 1
  • Karma: 0
The reason the module is broken when using loadposition, etc, is because doing so forces the accordion module javascript (which is written in, and therefore relies upon, jQuery library) to load prior to the jQuery library being loaded. A simple "View Source" command in any browser will reveal this. Therefore, the trick is to load jQuery prior to any module code.

Now, every template potentially loads its various javascript libraries in different ways, and your preferred jquery library may not be located in the site filesystem where mine is. Also, it's not always clear from the template
index.php
file where it's actually doing the loading. Therefore, you may need to tweak the following script accordingly. That said, essentially all I did here was hardcode the jQuery loading scripts into the template
index.php
file as follows (note the <!--comments--> below for more detail):
<!-- below is the html tag, starting the html off -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >

<!-- some Internet Explorer fixes because... well, because Microsoft. -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

<head>  <!-- the head tag! all the scripts and supporting files get loaded here --->
<!-- just beneath the head, the following three script tags are hardcoded to load jQuery as early as possible in the page load. -->
<script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>
<script src="/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
<script src="/media/jui/js/jquery-migrate.min.js" type="text/javascript"></script>

<!-- then the joomla jdoc call to bring in all other scripts -->   
	<jdoc:include type="head" />

	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- then stylesheets and erthing else... -->
	<!-- Stylesheets -->

So in other words, load in jQuery as early as possible, so that it loads before the accordion module scripts are called. One caveat is that this method loads jQuery twice, first in the hardcode, the second time in the jdoc call. This almost certainly slows down the page load, though I couldn't say how severe this slowdown would be.

cheers!
The administrator has disabled public write access.

Vina Article Accordion 9 years 8 months ago #1157

  • Mette Staerk
  • Mette Staerk's Avatar
  • OFFLINE
  • New Member
  • Posts: 4
  • Orders: 0
  • Download: 1
  • Karma: 0
@ David
Thank you so much for your effort!
Unfortunaly it did not work. I don´t think it has to do with my template, because I tried with the beez3 and protostar template too, and this did not work either.
So I assume, I have installed something, which conflicts somehow. :S

I must find another way to show, what I want to show.
The administrator has disabled public write access.

Vina Article Accordion open close icons not displaying? 9 years 8 months ago #1162

  • scott morgan
  • scott morgan's Avatar
  • OFFLINE
  • New Member
  • Orders: 3
  • Download: 5
  • Karma: 0
Hi, I have the module set up to display inside an article with the catagory source selected, everything looks ok except for the all important open close functionality? I have display open/close icons set to 'yes' but to no avail? Here is the link to the page, any ideas please?

118.127.45.10/~wrayowen/index.php/about-.../when-a-death-occurs
The administrator has disabled public write access.

Vina Article Accordion Problems with load position 9 years 8 months ago #1167

  • Rango
  • Rango's Avatar
  • OFFLINE
  • Administrator
  • Posts: 848
  • Thank you received: 115
  • Karma: 22
@scott morgan & @Mette Staerk: I think you have the same problem with Andy. Please follow this to solve the problem: vinagecko.com/forum/free-joomla-modules/...e-accordion?start=54
Rango wrote:
Dear Andy,

I've checked your website, and i see the problem, that's our module load javascript before your site load jQuery library.
I've fixed it for your case, you can download attachment file (extract it) and upload it to this path: ROOT/modules/mod_vina_accordion_content/tmpl/
Please try do it and let me know how it work.

Best regards.
No pain no gain! Accept the pain, future will be fruitful!
Last Edit: 9 years 8 months ago by Rango.
The administrator has disabled public write access.
Leather Purses & Handbags, Women’s Crossbody Bags, Tote Bags for Women, Leather Backpacks, Men’s Wallets & Card Cases, Official OLEVS Website, OLEVS Couple Watches, OLEVS Women's Watches, OLEVS Men's Watches, OLEVS Watch, OLEVS Watches