How to make a Joomla template?
Before you start working with Joomla 2.5, you need to install on the server its latest version, containing demo data, from which you should remove unwanted items. On the example of the creation topic for the Joomla 2.5 version, we will consider the question of how to create a template for Joomla. First you need to install the previously created archive in Joomla. To do this, you must use the template manager, through which your own default template is enabled.
- After the trial data is deleted, you need to enable the resulting template in the admin panel. Then go to the site where you can see the white sheet. This is because no working code is yet in the new template.
- To estimate the future structure of the template. For example, the structure will consist of a header, top menu (navigation), content, right column, and basement.
- Create a site layout. To edit, open the index.php file, first connect the output function of the Joomla head meta tags. Write the html-tags of the frame, and enter data into the block.
- Connect Joomla meta tags. Connect standard output.Go to the css folder, delete all the contents and create your own file called template.css, where your template styles will be written. After that, open index.php again and connect your css.
- Include the style file by defining the path to the folder with the template. The php element insert echo $ this-> baseurl - displays the url of the site, and the insert $ this-> template represents the path to the template folder. After entering the parameters, it is necessary to go to the site and check whether the css file is correctly connected. Now, make the html markup of the template. Creating styles and structure of the site can be immediately, looking at what kind of site has.
- When the main blocks of the page are laid out, you need to make sure that the template looks correct and does not fall apart. After this, you can add module positions. Example: A top navigation menu is added. The position is called topmenu. Go to the templateDetails.xml file, then append to the blocktopmenu(the position can be any name you prefer).
- Next, to make a template for Joomla 2.5, you need to add a module position such as topmenu to the templateDetails.xml file. Now you should save and go back to the index.php file, where to bind the output of this position in the place you need. To do this, use the line:
<jdoc:include type="modules" name="topmenu" />
- The module is displayed in the right place. The position name found in the templateDetails.xml file is used as the name parameter. Accordingly, now the #topmenu block displays the position of the topmenu module. To view the position of the modules in the browser, you must enable this feature in the admin panel. Go to the template manager, open options and select "display template fields".
- Now, if you go to the site and enter the following in the address bar: http: // site address /? Tp = 1, you can see which fields are in the template. To bring the menu to the topmenu position, go to the module manager, select the menu module, publish to the topmenu position, select “display on all pages” and view. A menu should appear on the site.
- Now make the menu to your liking through template.css. When it is ready, you can display the page content using the line:
<jdoc: include type = "component" />.
Now you can start styling for articles, links and other things. You can also read about some important and tricky moments, as well as how to download, prepare or make a joomla template on the pages and.