TYPOlight Open Source CMS > TYPOlight forum

Switch to german forum

Index > Off topic > Typolight and jQuery?

s.fakir
User
Avatar
Hi there,
I have worked with Javascript for years and I'm sure, Mootools isn't bad choice.

But, overall jQuery has a bigger community, more functionality and it seems to be faster aswell (I think off the code and not the filesize.)

What do you think about jQuery in Typolight?
Anybody uses it?

have a nice day.

Simon
24/05/2009 21:18
qrczak
User
Avatar
Posts: 550
Elbląg, Poland
Hi s.fakir,

jQuery is good solution but I don't think that Leo (main developer) will change js framework in typolight.
But actually it's not so hard to change mootools to jquery. I made sites based on typolight but with jquery. That's true, sometimes I had to change something or write additional js functionality.
I'm currently working on the site (based on typolight) where is no mootools but jquery, jquery UI and few other js scripts related to jquery. And it's work with typolight without any change in typolight core files (changes was only in my own tpl files).
Conclusion: if you really need you can build typolight site with jquery. :-)
Martin

http://www.typolight.pl - Polish Support Site
http://forum.typolight.pl - Polish TYPOligth community forum
Polish TYPOlight screencasts
| Polish Manual (PDF)
-----------------------
Need custom template? Feel free to contact me by e-mail marcin@typolight.pl
03/06/2009 22:51
Doublespark
Partner
Avatar
Posts: 47
March, United Kingdom
Hi Martin,

I would also like to consider using jQuery, if you ever get a chance to produce a walk through of the steps required it would be gratefully received.

Thanks,

Gary.
04/06/2009 10:43
Toflar
User
Avatar
Posts: 1070
Lyss, Switzerland
Using the frontend with jQuery is really very easy.
Just delete both the <script> tag for mootools:
iconhtml4strict:
<script type="text/javascript" src="plugins/mootools/mootools.js"></script>
and the following php line in your fe_page.tpl:
iconphp:
<?php echo $this->mootools; ?>

Then you can include your jquery scripts by adding them the same way as you removed the moootools <script> part before or just add them in your page layout where it says 'additional <head> tags'.

But be careful! Of course the provided content elements 'accordion' e.g. doesn't work anymore because it uses mootools.

So if your editors know, that they cannot use the whole TL functions, it's fine ;)
Regards / Salutations / Gruss

Yanick

certo web & design - www.certo-net.ch
04/06/2009 11:42
qrczak
User
Avatar
Posts: 550
Elbląg, Poland
iconToflar:
But be careful! Of course the provided content elements 'accordion' e.g. doesn't work anymore because it uses mootools.
So if your editors know, that they cannot use the whole TL functions, it's fine ;)

Hi Toflar

Yes, your right but I think if I get jquery 'accordion' script i can adjust it for work with TL html code related to accordions. Currently in one of my installation I changed full preview mode to jquery lightbox script without any touch of TL core files (it was changed only js files). Note that I still talking about default installation but we have to remember about additionals modules which use mootools too - that is real problem to move from mootools to jquery in TL.
Martin

http://www.typolight.pl - Polish Support Site
http://forum.typolight.pl - Polish TYPOligth community forum
Polish TYPOlight screencasts
| Polish Manual (PDF)
-----------------------
Need custom template? Feel free to contact me by e-mail marcin@typolight.pl
07/06/2009 21:29
ramjet
User
Avatar
Posts: 295
New Zealand
According to the Jquery site, there are ways around conflicts with other libraries (eg Mootools).
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
It should therefore be possible to incorporate it without touching TL coding for Mootools.

iconQuote:
The jQuery library, and virtually all of its plugins are constrained within the jQuery namespace. As a general rule, "global" objects are stored inside the jQuery namespace as well, so you shouldn't get a clash between jQuery and any other library (like Prototype, MooTools, or YUI).

That said, there is one caveat: By default, jQuery uses "$" as a shortcut for "jQuery"

......

iconQuote:
Including jQuery before Other Libraries
If you include jQuery before other libraries, you may use "jQuery" when you do some work with jQuery, and the "$" is also the shortcut for the other library. There is no need for overriding the $-function by calling "jQuery.noConflict()".

iconCode:
 <html>
 <head>
   <script src="jquery.js"></script>
   <script src="prototype.js"></script>
   <script>
     // Use jQuery via jQuery(...)
     jQuery(document).ready(function(){
       jQuery("div").hide();
     });
     
     // Use Prototype with $(...), etc.
     $('someid').hide();
   </script>
 </head>
 <body></body>
 </html>
12/06/2009 02:35