0
Hi there
I have got the Content Statistics Module that i want working perfectly on a Joomla page using the standard Joomla Protostar template.
When i publish the module to a page on my site that is using a custom Joomla template, i cannot get the module to display.
The module is there on the page, but something is preventing it from displaying.
As i am using a custom Joomla template some elements of the Joomla system i do not want loaded into my template, so i have added some PHP code to the top of my Joomla template to unset / remove the following:
// Remove Scripts
$doc = JFactory::getDocument();
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.min.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.min.js']);
?>
When i look in my Chrome Browser Dev Tools, i can see the Console area notifying me of some errors on that DOM element. The following errors are being displayed:
Uncaught ReferenceError: jQuery is not defined
Any ideas what may be causing this problem ?
Thanks again for your kind support and great product.
I have got the Content Statistics Module that i want working perfectly on a Joomla page using the standard Joomla Protostar template.
When i publish the module to a page on my site that is using a custom Joomla template, i cannot get the module to display.
The module is there on the page, but something is preventing it from displaying.
As i am using a custom Joomla template some elements of the Joomla system i do not want loaded into my template, so i have added some PHP code to the top of my Joomla template to unset / remove the following:
// Remove Scripts
$doc = JFactory::getDocument();
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.min.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.min.js']);
?>
When i look in my Chrome Browser Dev Tools, i can see the Console area notifying me of some errors on that DOM element. The following errors are being displayed:
Uncaught ReferenceError: jQuery is not defined
Any ideas what may be causing this problem ?
Thanks again for your kind support and great product.
Responses (5)
-
Accepted Answer
0well, the problem you're having is that jQuery is not being loaded. this has nothing to do with CS (because it doesn't use jQuery)
basically what you're saying is that you are removing jQuery from your template (with the unset thing..) but.. that causes precisely the error, because there's sometething using it. in particular:
this makes the JS crash when jQuery is called, and therefore any code that comes next (like the stats graph) doesn't display
you need the jQuery back..! -
Accepted Answer
0Hi there Germinal
Thanks again for clarifying that.
The problem i have is that when i load the jQuery it causes other conflicts with my template . So i have had to remove the standard Joomla jQuery stuff that is being loaded by Joomla.
I have an idea - This module is intended to work in a kind of dashboard area for my users to just see their activity.
Will the module work if i display if using an iFrame ? So for example, i set the module up on my other joomla page, and then display it on my template page using an iFrame. Do you think this will work with your module ?
Thank you again for helping me. -
Accepted Answer
-
Accepted Answer
0Hey Germinal
Thank you for your reply.
I have got the iframe method working perfectly for me.
I am using iframe to display Content Statistics Evolution In Time module i have setup on another page using standard Joomla template. The module i am accessing on that page using iframe is the module that display chart data to that user > Filters results to viewing user. So just that logged in user sees chart relevant to just them. So i have it set so that user can see how many profile views they have done on JomSocial, Group Views etc, and the chart works perfectly to show that user their own activity.
I have then stripped any graphic design elements from that default Joomla template so only module is left displaying, and that then displays nicely in my iframe, and integrates with my template.
This way i am able to avoid any template conflicts.
I understand this method may not work for displaying chart data to a specific group page / profile etc, due to module needing to be on that specific page.
Thank you again for your support and help to clarify things.
Mark
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »