본문 바로가기

카테고리 없음

Index Php Joomla Download For Mac

Contents. Introduction The purpose of this tutorial is to serve as an introduction to creating Joomla! It will cover the essential files and code needed to create a basic template. The code is presented so it can be copy and pasted with very little modification needed. Setting up a directory structure To make the most basic template, create a new folder in the templates folder. Name this folder after your template i.e.

Index Php Joomla Download For Mac Download

Using your favourite text editor create the files index.php and templateDetails.xml. To keep things organized, make 2 new folders called images and css. Inside the css folder create a file called template.css.

Although it is fine to place all your code directly in your index.php file to start, many web developers prefer to place their CSS code in a separate file that can be linked from multiple pages using the link tag. This may also shorten the loading time of your pages, since the separate file can be cached. This is the most basic practical setup. Outline of folder and file structure:. mynewtemplate/. css/.

template.css. images/. index.php.

templateDetails.xml Creating a basic templateDetails.xml file The templateDetails.xml file is essential. Without it, your template won't be seen by Joomla! The file holds key about the template. The syntax of the file is different for each Joomla version. For, use the following.

1.5//DTD template 1.0//EN' ' mynewtemplate 2008-05-01 John Doe john@example.com John Doe 2008 GNU/GPL 1.0.2 My New Template index.php templateDetails.xml images css breadcrumb left right top user1 user2 user3 user4 footer For and later, use the following version. Change version='2.5' into the version of your Joomla! Mynewtemplate 2008-05-01 John Doe john@example.com John Doe 2008 GNU/GPL 1.0.2 My New Template index.php templateDetails.xml images css breadcrumb left right top user1 user2 user3 user4 footer So, as you can see, we have a set of information between markup tags (the s). Your best approach is to copy and paste this into your templateDetails.xml file and change the relevant bits (such as and ). The part should contain all the files that you use - you possibly don't know what they are called yet - don't worry, update it later. The element can be used to define an entire folder at once.

Leave the positions as they are - these are a common set so you will be able to switch easily from the standard templates. Creating a basic index.php file The index.php file becomes the core of every page that Joomla! Essentially, you make a page (like any HTML page) but place code where the content of your site should go. The template works by adding Joomla code into module positions and the component section in your template. Anything added to the template will appear on all pages unless it is added to one of these sections via the Joomla CMS (or customised code). This page will show the bare-bones code ready for you to cut and paste into your own design. Begin A Joomla template begins with the following lines.

However this is used in Joomla and higher. The third line begins our HTML document and describes what language the website is in.

A html document is divided into two parts, head and body. The head will contain the information about the document and the body will contain the website code which controls the layout. The first line gets Joomla to put the correct header information in.

This includes the page title, meta information as well as system JavaScript. The rest creates links to two system style sheets and to your own style sheet (if it's named template.css and is located in the css folder of your template directory. So if your template is in then the css files will go in Body Section.

Amazingly, this will suffice! Yes, it's a very basic layout, but it will do the job.

Everything else will be done by Joomla! These lines, usually called, tell Joomla to include output from certain parts of the Joomla system.

Note: you will need to ensure your menu is set to go into the 'top' module position. Module Positions Above, the line which says name='top' adds a module position called top and allows Joomla to place modules into this section of the template. The type='component' line contains all articles and main content (actually, the ) and is very important.

It goes in the centre of the template. Note: You can add your own module lines anywhere you want in the body, but you have to add a corresponding line to the templateDetails.xml file which sits alongside the index.php of your template.

End Finish it off - one last bit.

That you have created a new template. This feature is called Discover Extensions and can be accessed via Extensions - Extension Manager - Discover (i.e. The Discover tab). Click Discover (i.e. The Discover button) to discover your template, then select it and click Install to install it. Now your template should show up in the, accessible via Extensions - Template Manager.

Note you can create your template outside of Joomla and simply install it like any regular extension. HINT: there are a couple of ways you can preview your index page as you put it together, either insert the styles into the head of the index page or directly link it to the style sheet you will be using temporarily. You can remove these links before packaging the file. Packaging the template for installation A directory with several loose files is not a convenient package for distribution. So the final step is to make a package. This is a compressed archive containing the directory structure and all the files. The package can be in ZIP format (with a.zip extension), in TAR-gzip format (with a.tar.gz extension), or in TAR-bz2 format (with a.tar.bz2 extension).

If your template is in a directory mytemplate/ then to make the package you can connect to that directory and use commands like:. tar cvvzf./mytemplate.tar.gz. zip -r.

Index

Mytemplate.zip. Note to Mac OS X users Note to template developers using Mac OS X systems: the Finder's 'compress' menu item produces a usable ZIP format package, but with one catch.

It stores the files in AppleDouble format, adding extra files with names beginning with '.' . Thus it adds a file named '.templateDetails.xml', which Joomla 1.5.x can sometimes misinterpret. The symptom is an error message, 'XML Parsing Error at 1:1. Error 4: Empty document'. The workaround is to compress from the command line, and set a shell environment variable 'COPYFILEDISABLE' to 'true' before using 'compress' or 'tar'. See the article for more information.

Joomla

To set an environment variable on a Mac, open a terminal window and type: export COPYFILEDISABLE=true Then in the same terminal window, change directories into where your template files reside and issue the zip command. For instance, if your template files have been built in a folder in your personal directory called myTemplate, then you would do the following: cd myTemplate zip -r myTemplate.zip. Conclusion You should now have created a template that works. It won't look like much yet. The best thing to do now is start experimenting with the layout.