Hi all,
What javascript code snippet do I need to include into my page.tpl file in order to make it support mootools?
I have tried searching the forum, but could not find what I am looking for.
Thank you
Printable View
Hi all,
What javascript code snippet do I need to include into my page.tpl file in order to make it support mootools?
I have tried searching the forum, but could not find what I am looking for.
Thank you
Or this is what I have done:
Added a new element: Accordion (single)
Gave it a header name and added some text.
In the page layout settings I enabled moo_accordion
But when I view the page in the frontend, the header text and the body text appear and there is no accordion effect.
I'm sure I am missing something, but at this point I am unsure what it is.
I tried adding this to the <HEAD> section of my page template but it didn't work:
Code:
<script type="text/javascript">
<![CDATA[//><!--
window.addEvent('domready', function() {
new Accordion($$('div.toggler'), $$('div.accordion'), {
alwaysHide: true,
opacity: false
});
});
//--><!]]>
</script>
You don't need to add anything to the template.
Mootools core/more is automatically added to the head, and if you select moo_accordion in the page layout, the file "moo_accordion.tpl" will get inserted before the body close tag.
If it's not working for you, post a URL to an example page where it isn't working and we'll take a look.
I guess there's a problem with the MooTools framework scripts.
Have you modified the standard page template "fe_page.tpl"?
Yes, a completely new template was created for me.
I assume whatever code snippet that is required by mootools to work has been taken out.
Anyone know what the default code is?
This is the default page template code: http://dev.contao.org/projects/typoligh ... e_page.tpl
Thanks very much, and do you know where the actual mootools framework files are stored in the file structure of contao? I think those were removed as well because after adding all mootools relevant code sections to my template still nothing happens.
"plugins/mootools"Quote:
Originally Posted by partisanentity
I would recommend running the Contao System Check Tool to check whether some core files are missing or corrupt.
Sorry for the confusion, all files are in the right place.
But what I noticed is that when I view the html...
There is nothing where this tag is supposed to be:
Otherwise with this tag:Code:<?php echo $this->mooScripts; ?>
It displays this:Code:<?php echo $this->mootools; ?>
So it seems the only issue I am having now is that nothing gets displayed with this tag:Code:<script type="text/javascript" src="plugins/mediabox/js/mediabox.js"></script>
<script type="text/javascript">
<![CDATA[//><!--
Mediabox.scanPage = function() {
var links = $$("a").filter(function(el) {
return el.rel && el.rel.test(/^lightbox/i);
});
$$(links).mediabox({/* Put custom options here */}, null, function(el) {
var rel0 = this.rel.replace(/[[]|]/gi," ");
var relsize = rel0.split(" ");
return (this == el) || ((this.rel.length > 8) && el.rel.match(relsize[1]));
});
};
window.addEvent("domready", Mediabox.scanPage);
//--><!]]>
</script>
<script type="text/javascript">
<![CDATA[//><!--
window.addEvent('domready', function() {
new Accordion($$('div.toggler'), $$('div.accordion'), {
alwaysHide: true,
opacity: false
});
});
//--><!]]>
</script>
Code:<?php echo $this->mooScripts; ?>
First of all, it's always a good idea to indicate the version number from the system you're talking about. It looks like you have an older Contao installation...
I have 2.8.3, sorry for not having mentioned this earlier.
Ah, ok, then of coursedoes not work!Code:<?php echo $this->mooScripts; ?>
The page template for version 2.8.3 looks like this: http://dev.contao.org/projects/typoligh ... e_page.tpl
And here you find the System Check Tool for version 2.8.3: http://www.contao.glen-langer.de/System ... .8.3.0.zip
Okay I think there is an incompatibility with some of the scripts on my page because I tested the default fe_page.tpl and the accordion worked.
But when I test the accordion on my default template it doesn't work.
I'm going to make a copy of the template I use, and slowly start eliminating sections until the accordion works.
I will post back.
Thanks very much for your help so far xchs