Calcetines Extreme

Calcetines Extreme
Take care of you using the best socks

Wednesday, July 25, 2012

add a own style sheet to a template



Problem:

We need to add a own style sheet to our template to avoid make changes on exiting template style sheet, the change is to avoid lose that change when we update or change the template.

Solution:
Create your own stylesheet.css file and upload to your styles folder, a good place is a new folder outside joomla default structure.

Search for template folder httpdocs/templates/<yourdefaulttemplate>/index.php; you can edit that file using extplorer joomla extensión or directly from joomla template editor.

after <head tag> insert that piece of code:

// Add a reference to a CSS file
JHTML::stylesheet($filename, $path);

$filename: will be the name of your own style sheet like "mystyle.css"
$path: that is the complete path to the filename selected before, like: "..\..\customcode\mystyle.css"

Another solution for a lit of templates in joomla than use gantry framework to use the addstyle method.

<? php $gantry->addStyles(array(' mystyle .css')); ?>

Thats is a sample where you can see how to add the new sheet on a gantry:

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $gantry->language; ?>" lang="<?php echo $gantry->language;?>" >
<head>
<?php
$gantry->displayHead();
$gantry->addStyles(array('template.css','joomla.css'));
$gantry->addStyles(array(' mystyle .css'));
...

Source links:

setup joomla directory permissions chmod

Problem:

One of the best features of joomla is the quick installation process that allow to install the cms online in just only 5 min; but after the installation there is a little issue that give me a rudimentary work to do always.

That dammed work is to change directory permissions on all joomla directory on administrator->system info->Directory permissions; around 28 directories on joomla 1.5.

Solution:

I have created a ftp batch file that change the directory permissions on all joomla 1.5 directories, that batch make the joomla installation more quick.

1.- create a txt file name <myftpbatch>.txt
2.- insert that code on file:

open www.yoursite.com
<user>
<pwd>
cd httpdocs
quote site chmod 0777 administrator/cache
quote site chmod 0777 administrator/backups
quote site chmod 0777 administrator/components
quote site chmod 0777 administrator/language
quote site chmod 0777 administrator/language/en-GB
quote site chmod 0777 administrator/modules
quote site chmod 0777 administrator/templates
quote site chmod 0777 components
quote site chmod 0777 images/
quote site chmod 0777 images/banners
quote site chmod 0777 images/stories
quote site chmod 0777 language
quote site chmod 0777 language/en-GB
quote site chmod 0777 language/pdf_fonts
quote site chmod 0777 media
quote site chmod 0777 modules
quote site chmod 0777 plugins
quote site chmod 0777 plugins/content
quote site chmod 0777 plugins/editors
quote site chmod 0777 plugins/editors-xtd
quote site chmod 0777 plugins/search
quote site chmod 0777 plugins/system
quote site chmod 0777 plugins/user
quote site chmod 0777 plugins/xmlrpc
quote site chmod 0777 templates/
quote site chmod 0777 cache
quote site chmod 0777 new/administrator/cache
quote site chmod 0777 logs
quote site chmod 0777 tmp
quote site chmod 0777 dir
bye
3.- run de following command trough a command window on your local computer:
ftp -s:<myftpbatch>.txt

just done, on only 3 steps now you will have all joomla directories writeable.
that have been tested on Joomla 1.5 installation, when i need it on another joomla version i will update the post.



Source links: