- Posts: 4
Postings
You can freely browse the forum and post in the community forum.
However, you need a valid license to write posts for support (own a valid commercial software license or have purchased a support membership).
Posts only show once reviewed. This is mainly preventive to keep spam away. Thank you for your understanding!
Plugin stops template parameters being read
- tomsel
-
Topic Author
- New Member
-
Less
More
IP: 94.197.127.77
14 years 9 months ago #102
by tomsel
Plugin stops template parameters being read was created 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:
At required point in template where layout changes are required:
Which corresponds to this section:
Finally, you can see the problem live at:
www.tomseldon.co.uk/thehaircentre
Thanks,
Tom
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:
Code:
/* 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:
Code:
<? 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:
Code:
<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
- admin
-
- Administrator
-
Less
More
- Posts: 1931
IP: 207.181.196.3
14 years 9 months ago #103
by admin
Olivier.
Replied by admin on topic Re: Plugin stops template parameters being read
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.
- admin
-
- Administrator
-
Less
More
- Posts: 1931
IP: 207.181.196.3
14 years 9 months ago - 14 years 9 months ago #104
by admin
Olivier.
Replied by admin on topic Re: Plugin stops template parameters being read
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.
$j
with
jQuery
You also have mootools-core.js and mootools-more.js loaded twice.
Olivier.
Last edit: 14 years 9 months ago by admin.
- tomsel
-
Topic Author
- New Member
-
Less
More
- Posts: 4
IP: 92.40.253.231
14 years 9 months ago #107
by tomsel
Replied by tomsel on topic Re: Plugin stops template parameters being read
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:
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
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:
Code:
/* 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
- admin
-
- Administrator
-
Less
More
- Posts: 1931
IP: 207.181.196.3
14 years 9 months ago #108
by admin
Olivier.
Replied by admin on topic Re: Plugin stops template parameters being read
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...
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.
- tomsel
-
Topic Author
- New Member
-
Less
More
- Posts: 4
IP: 92.40.253.231
14 years 9 months ago #109
by tomsel
Replied by tomsel on topic Re: Plugin stops template parameters being read
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.
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.
