Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file Plugin stops template parameters being read

More
12 years 9 months ago #102 by tomsel
I've installed jQuery Easy and for the most part it's solved all the conflict issues I was having. However, it's had the unexpected side effect of disabling the use of template parameters.

Each page on my site has it's own template style defined from the Templates section of the admin area, and where one is not defined the layout 'default' is used.

The template index.php checks what the template style is for the relevant menu item and then includes a PHP file corresponding to that layout.

This was all working correctly until I enabled this plugin. Now, I have no jQuery conflicts but all menu items display the 'default' layout and I have no idea why. I'd kill for some help to solve this as it seems I'm so close getting it all to work, but at a complete loss how to continue.

Anyway, the relevant section(s) from the template index.php:

Start of file, before any HTML is outputted:
/* Import page layout */
$pageLayout = $this->params->get('pageLayout');
$pageLayout = './templates/'.$this->template.'/layout/'.$pageLayout.'.php';

At required point in template where layout changes are required:
<?	require_once($pageLayout); ?>
[/i]

Again, that displays fine with the plugin disabled and the menu item is correctly attributed to the right layout file. As soon as the plugin is enabled, [i]$this->params->get('pageLayout');[/i] reverts from let's say, 'home' to 'default'.

Any ideas?

Also, with the plugin enabled the only errors in Chrome console are:
[code]
Uncaught ReferenceError: $j is not defined - Line 34

Which corresponds to this section:
 <script type="text/javascript">
jQuery.noConflict();
function keepAlive() {	var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(840000); });
			$j(document).ready(function(){
				$j('a.modalizer_link,a.modal,a.modalizer').colorbox({width:'80%',height:'80%',iframe:true});
				$j('a.modalizer_link_image').colorbox({});
				$j('a.modalizer_link_external').colorbox({width:'80%',height:'80%',iframe:true});
			});		
  </script>

Finally, you can see the problem live at:
www.tomseldon.co.uk/thehaircentre


Thanks,

Tom

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #103 by admin
I am looking at it right now. So far I can not reproduce the problem on my test website. I will get back to you as soon as I understand what is going on.

Olivier.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago - 12 years 9 months ago #104 by admin
So far I can see that you need to replace
$j
with
jQuery

You also have mootools-core.js and mootools-more.js loaded twice.

Olivier.
Last edit: 12 years 9 months ago by admin.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #107 by tomsel
Thanks for getting back to me. I've disabled components/plugins that could have been contributing to the problem; I now have no errors in the Chrome console.

However, the problem hasn't been solved. With jQuery Easy active, Joomla seems to lose the ability to read the template parameter I've set. Deactivating it sees everything work fine (apart from re-introducing jQuery conflicts).

I'm not sure how the plugin works and so can't really understand how it could be affecting the template parameters.

As I said previously, I've simply using the following code to retrieve the set paramter:
/* Import page layout */
$pageLayout = $this->params->get('pageLayout');
$pageLayout = './templates/'.$this->template.'/layout/'.$pageLayout.'.php';

I thought perhaps the plugin was somehow stripping this code out, however I don't think that's the case as a valid (but incorrect) $pageLayout variable is retrieved.

By default, all menu items have the layout style 'default' set. Individual menu items then have specific styles assigned to them such as 'home', 'services', etc.

With the plugin disabled, the correct parameter is retrieved. With the plugin enabled, the parameter 'default' is always returned, as if it's ignoring the menu ID?

Thanks again for your help, it's greatly appreciated.

Tom

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #108 by admin
The plugin has no effect on the template parameters. It only replaces, reorders and adds jQuery libraries in the head block of the template. That is all it does...
Did you compare the output source code before and after the enabling of the plugin? What is different? Difficult for me to diagnose anything without the complete code...

Olivier.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #109 by tomsel
I hadn't attached the complete source code because I didn't want to bloat the page with a load of code, but if it'll help I'll attach it to this post.

The first is with jQuery Easy turned on and the second attachement is with the plugin disabled.

At the moment with the plugin disabled I'm not actually getting any conflicts, however I'd still like to use this plugin as when I re-enable several of the components I'll end up with surplus instances of jQuery and Moo Tools being loaded again.

location-jqueryEasy-On.html
location-jqueryEasyOff.html

Please Log in or Create an account to join the conversation.