Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Creating template in Joomla

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 110
    Comment on it

    Two files are required to create a template in Joomla. First is the index.php file, in this file we can place php code where the content of site should go and second file is templatedetails.xml which includes all the configuration settings and parameters required. One CSS file is also required where we can put our CSS related work. All these files will work together and produce content for Joomla website.

    Now create a new folder inside templates folder. Inside a folder create one text file name as index.php file and other is templateDetails.XML file and one css folder. Inside css folder create template.css file. So we need to link template.css file to index.php file. Place the content which is given below in templateDetails.XML file. In this file we will add template related information and basic module positions settings.

    <?XML version="1.0" encoding="utf-8"?>  
    
    <!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN"  
    
    "http://dev.joomla.org/XML/1.5/template-install.dtd">  
    
    <install version="1.5" type="template">  
    
          <name>your_template_name</name>  
    
          <creationDate>15-3-2015</creationDate>  
    
           <author>yourname</author>  
    
           <authorEmail>your@email.com</authorEmail>  
    
           <authorUrl>http://www.siteurl.com</authorUrl>  
    
           <copyright>You 2011</copyright>  
    
           <license>GNU/GPL</license>  
    
           <version>1.0.0</version>  
    
           <description>Joomla template</description>  
    
           <files>  
    
                   <filename>index.php</filename>  
    
                   <filename>templateDetails.XML</filename>  
    
                   <filename>css/template.css</filename>  
    
            </files>         
    
    
    
           <positions>  
    
                     <position>top</position>
                                   <position>left</position>
                                   <position>right</position>          
                                   <position>bottom</position>
                                   <position>banner</position>
                                   <position>syndicate</position>
                                   <position>footer</position>
                                   <position>user1</position>
                                   <position>user2</position>
                                   <position>user3</position>
                                   <position>user4</position>          
    </positions>  
    
    </install> 
    

    Next open an index.php file and place the content which are given below.

    <!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 $this->language; ?>" lang="<?php echo $this->language; ?>" >  
    <head>  
    <jdoc:include type="head" />  
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/your_template_name/css/template.css" type="text/css" />  
    </head>   
    <body>  
    <div id="container">  
    <div id="header"><jdoc:include type="modules" name="top" /> Header information</div>  
    <div id="sidebar_left" class="float">
    <jdoc:include type="modules" name="left" />
    </div>  
    <div id="sidebar_right"class="float"><jdoc:include type="modules" name="right" />Right sidebar</div>  
    </div>  
    </div>  
    </body>  
    </html>
    

    Next is to create a zip file and install the template from Joomla administrator panel. Once installed it will appear under template manager where you will mark it as a default to display on front end website.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: