The Joomla! Forum ™



Forum rules


Please use the official Bug Tracker to report a bug: http://joomlacode.org/gf/project/joomla ... er_id=8103



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Nov 01, 2010 8:59 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jun 09, 2006 7:32 pm
Posts: 42
I've found a issue in Joomla with template: All templates loads hard coded the javascript files, javascript source code, stylesheet files or css definitions in the index.php file instead of using the Joomla Framework.
This could result in duplicate javascript or css om a page.

It's not a big problem, but a good practice for making right templates.
They should use:

Code:
$doc =& JFactory::getDocument();
$doc->addScript("http://www.example.com/js/myscript.js");

or
Code:
$doc =& JFactory::getDocument();
$doc->addStyleSheet( 'http://www.example.com/css/mystylesheet.css' );


The problem happens when using a plugin like include component where another page of a component is loaded in another page/article and the javascript and stylesheets are copied to the calling page.
Also the javascript and stylesheets will be grouped in the source of the page.

This should be changed in the documentation for developing templates.

Please let me know your vision.


Top
 Profile  
 
PostPosted: Wed Nov 03, 2010 12:17 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7846
Location: New York
That's very interesting, would you please post this on the CMS mailing list?

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Thu Nov 04, 2010 7:13 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jun 09, 2006 7:32 pm
Posts: 42
I will post it on the CMS mailing list too


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 



Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group