Joomla Components Putting CSS In Source Code - Joomla! Forum - community, help and support
hi folks,
i have put new joomla 2.5 website , notice few of components/modules put css within pages of site instead of linking seperate css file.
this terrible web development practice no css code should included in pages.
is normal when using joomla , can resolve this? here example website, @ source code: http://tellitphotoweddings.co.uk/
i have put new joomla 2.5 website , notice few of components/modules put css within pages of site instead of linking seperate css file.
this terrible web development practice no css code should included in pages.
is normal when using joomla , can resolve this? here example website, @ source code: http://tellitphotoweddings.co.uk/
hi gobbly,
as joomla developer, can give few hints in why happens , can do.
on 1 hand, happens lot because developer cuts corner. in cases, , see in link in testimonials section, css included directly in source code being generated based on content entered in joomla. means can't stick in external style sheet, because have have php code generate database.
there other methods (actually make files, have css generate on second call script link in css link), of these introduce other issues. , since many components free or cheap , software function when stick css in source code, there isn't lot of incentive go mile in regard.
the intermediary me @ least scripts , styles header (and minimize them pieces require values generated database).
to script header, can typically use following code:
you can see document functions here: http://docs.joomla.org/jdocument
as joomla developer, can give few hints in why happens , can do.
on 1 hand, happens lot because developer cuts corner. in cases, , see in link in testimonials section, css included directly in source code being generated based on content entered in joomla. means can't stick in external style sheet, because have have php code generate database.
there other methods (actually make files, have css generate on second call script link in css link), of these introduce other issues. , since many components free or cheap , software function when stick css in source code, there isn't lot of incentive go mile in regard.
the intermediary me @ least scripts , styles header (and minimize them pieces require values generated database).
to script header, can typically use following code:
code: select all
$document =& jfactory::getdocument();
$css = '
#selector {
display:block;
height: 152px;
}';
$document->addstyledeclaration($css);
you can see document functions here: http://docs.joomla.org/jdocument
Comments
Post a Comment