Thứ Hai, 20 tháng 5, 2013

JOOMLA! PLATFORM 12.1


JOOMLA! PLATFORM 12.1

The Joomla! Platform is a software development framework for the developemt of web applications. This website documents the API of the Joomla! Platform and so does not include code from the Joomla! Content Management System (CMS).
On this page you can find the following information
  • The Joomla! Platform API reference, this information is available in the package called Joomla-Platform.
  • A number of third-party libraries used by Joomla! and/or is available for use by third-party Joomla! extensions.
Third-party libraries are documented here for completeness and because they contain valuable information not available elsewhere. However, to get the most out of the Joomla! Platform, and because libraries may be modified or replaced, please try to use the Joomla! Platform API in preference to calling the libraries directly.
Additional documentation is available on the Joomla! Documentation Wiki and in particular there is a manually produced API Documentation which has additional information and example code for classes and methods in the Joomla! Platform.
This website covers the 12.1 release of the Joomla! Platform. Source code is available on GitHub
These pages were generated from Joomla! Platform 12.1 Stable
(Sun, 20 May 2012 20:00:22 +0000)
SymbolDescriptionSymbolDescriptionSymbolDescription
ClassClassMethodMethodVariableVariable
Private classPrivate classPrivate methodPrivate methodPrivate variablePrivate variable
Abstract classAbstract classAbstract methodAbstract methodStatic variableStatic variable
Abstract private classAbstract private classGlobalGlobal
Static methodStatic methodConstantConstant
File folderFile folderConstructorConstructor
Class folderClass folderDestructorDestructorFileFile
Function folderFunction folderFunctionFunctionIndexIndex
Tutorial folderTutorial folderTutorialTutorial
Package folderPackage folderSubpackageSubpackage
If you notice any errors on any of these pages then please take a moment to report the problem on the Developer Documentation Forum. You can also ask questions on the Joomla! Platform Development Google Group

Setting up a quick start package on your local server - xampp (PC)


Setting up a quick start package on your local server - xampp (PC)

To start building a Joomla website you need a server environment to host the website:

You've got two options:

Use a live web hosting package using software like cpanel or Plesk. You would want to deny access to any casual browser till the site is finished.
Use a local hosting server environment on either your PC, Mac or linux – this could be WAMP (win), MAMP (mac), LAMP (linux), XAMPP (multi platform versions available) or separate installs of Apache, PHP and MYSQL.
Some people prefer to work in the local environment and then upload the finished site to a live server or others might simply prefer to work on a live server – all down to personal and client preferences.

XAMPP for PC

This short tutorial is focussing only on uploading quickstart packages to the XAMPP server on the PC (the extra P in XAMPP stands for Perl by the way but that doesn't matter here).
xampp for windows

Check your XAMPP is running correctly

Check both Mysql and Apache are running correctly. You can check this be opening the XAMPP control panel via the Windows start menu item for XAMPP.
xampp control panel on a pc

Software to extract the quickstart zip

You need to have a piece of software to extract the zip, which could be Winzip, Winrar, etc. There are many options available in both free and commercial software. I'm using Winrar here.
quickstart directory in winrar

Create a folder in xampp/htdocs

You create a new folder in this directory, which is the folder name you will use to load the site in the browser later e.g. localhost/testsite.

Extract files to folder

Extract the the quickstart content to the new folder.

Run installation

Open your browser of choice and type localhost/foldername and the installation process will start.
Localhost testsite browser bar

Select language of choice

I've chosen to work in English (United Kingdom)
Joomla Language choice

Pre-install check

This should all be green - in my case it is not, but I'm not concerned at this juncture with this particular error as I will alter the global configuration settings at a later date.
Joomla rre-install settings

License Joomla

Once read, click next to continue the install process

Database configuration

11.1 The first two dropdown boxes are normally left unchanged.
11.2 The username on a XAMPP should be root and the password left empty or what you configured it to be when you installed the XAMPP server.
11.3 Enter a database name (if you decided to create the database in phpmyadmin first, you need to enter that name).
11.4 Accept the random prefix (a random prefix makes Joomla 1.7 a little bit more secure than the standard 1.5 jos prefix – although you could change this in 1.5 if you wanted to).
Database basic settings
{jb_twelve}

FTP configuration

In most cases you will not need to enter anything here and you can safely skip this step.
{/jb_twelve} {jb_thirteen}

Install sample data

13.1 Click to install the sample data which will load the content of the demo site to your local version. All the text and downsampled images will now be populating the site – (photo licenses unfortunately forbid Bamboo from including high resolution images).
13.2 Enter the rest of the settings here for your site – these are editable inside the administrator side of the site. On the username we'd suggest anything other than admin or administrator
Hub Quickstart install sample data
{/jb_thirteen} {jb_fourteen}

Remove installation folder

Simply delete the installation folder by clicking the "remove installation folder" button.
{/jb_fourteen} {jb_fifthteen}

Quickstart up and running

An uploaded quickstart version of the Hub template.
hub quickstart {/jb_fifthteen}

How to disable the k2 version of jQuery


How to disable the k2 version of jQuery

Overview

Since the release of K2 v2.5, K2 has used jQuery as it's main javascript engine.
JQuery is a wonderful javascript library that generally sits well next to the core Joomla Mootools javascript library. Our templates and extensions use jQuery in no conflict mode so conflicts with other extensions while they can happen, are rare.
The main cause of jQuery javascript conflicts is when multiple versions of jQuery are loading on the page. This can happen if the module, plugin, template you are using also loads it's own version of the jQuery library.
K2 is set to load jQuery by default and tends to load it's version of jQuery after the Zen grid framework has also loaded it's own version. This will tend to result in our superfish menu or hidden panel not working. 
If this is what you are experiencing on your site then there are two ways to solve the issue.

Disable the K2 version of jQuery

1. Navigate to the K2 administration area in your Joomla administrator.
a. Navigate to yoursite.com/administartor
b. Once logged in navigate to components > k2 via the top menu
c. Once there click on the parameters icon.
jQuery0

2. K2 is set to load the latest version of jQuery via google by default.
jQuery2

3. Set the k2 jQuery option to "Do not load the jQuery library".
 jQuery1

2. Loading the latest version of jQuery via google.

Another way to ensure that there is only one version of jQuery loading on the page is to set the framework or JB LIbrary version of jQuery to use the latest available version of jQuery and to load it via Google. 
This works because when the browser sees that the same file is being requested twice then it only loads the first instance. 

1. Setting JB Library to use the latest available.
a. Navigate to extensions > plugin manager
b. Filter the plugins listed via the folder filter to system.
pluginsystem

c. Click on the JB Library listing.
library

d. Set the jQuery version loaded by the JB LIbrary to Latest version of jQuery and the jQuery source to google. 
jquery4

2. Loading the latest version of jQuery via google in your zen grid framework compatible template.
This option is available for all templates that are compatible with Zengridframework v2.2+ and JB Library v1.3+.

a. Navigate to the template manager in your Joomla administrator.
b. Click on your Zen grid framework template name.
framework0
c. Navigate to the settings tab in the Zen grid framework interface.
framework1

3. Scroll down to the bottom of the settings page and set the version of jQuery to be the latest and set jQuery to load from google.
framework2

Using the Joomla update manager to update Joomla 2.5


Using the Joomla update manager to update Joomla 2.5

Overview

Updating Joomla 2.5 is a matter of performing a few clicks in your Joomla admin via the Joomla extension manager.

In order to start the update process please ensure you navigate to your site's administrator area and then navigate to the Extension Manager.

Checking for updates.

Click on the update tab.
update1 

Purge cache

Hit the Purge cache icon to clear any previous searches for updates you may have made.
update Joomla 2
The screenshot below shows an old version of Joomla available, before the cache has been cleared.
Update Joomla 3 

Find Updates

Click the find updates icon.
Update Joomla 4 

Review Update available

Double check that the update available is indeed the latest available version of Joomla. You can normally see the version available via the Joomla.org homepage
Update Joomla 5 

Check the checkbox

Make sure you check the checkbox next to the version of Joomla you want to update to.
Update Joomla 6 

Click Update

update7

Success message

If all has gone well then you should see a success message as per the screenshot below.
 update8

One more step - Fixing the database

The database tells you whether your database is compatble with the version of Joomla you have installed. If you see errors after clicking on that tab then follow the steps outlined below.
update9

Click Fix

If you receive a warningthat the database has errors then click the Fix icon int he top right corner.
update10

 

Another success

If all has gone well again your database will have been updated and any missing columns add to the relevant database tables.
update11

Can't edit, save or apply changes via the Joomla front end editor


Can't edit, save or apply changes via the Joomla front end editor

Overview

This is a common issue and there are a number of possible issues that may lead to the user not being able to save or apply changes to their content via the Joomla front end editor.
The main issue we see with our Joomla templates is the use of the function in our framework that removes mootools from the output of the Joomla site.

Solution

The Joomla editor require to load on the front end in order for the editor buttons to function properly. In Zen Grid framework templates you need to ensure that mootools is not disabled in the template parameters if you or your client requires the front end editing option.

1. Navigate to the Settings > Performance panel in the template admin
removemootools1

2. Ensure that the mootools setting is set to either no or add via framework.
 removemootools2


How to enable error reporting in Joomla 25


How to enable error reporting in Joomla 25

Overview

Error reporting is a useful option to enable in Joomla when attempting to troubleshoot php errors on your Joomla site. These php errors generally result in a compeltely blank page or a partial page load.
Once error reporting is enabled the error will give you some clue as to which part of your Joomla setup is causing the issue. 

Navigate to your site's administrator and then go to the global configuration.

Navigate to your sites administrator via yoursite.com/administrator and login.
Once you have logged in then you need to navigate to to your site's global configuration
 error2

Click on the server tab and set error reporting to maximum

Please note that the developer setting for error reporting is a little overwhelming and will prvide too much information. Setting the status to maximum is ideal for trackign down php related issues.
error3

Check your frontpage

Once enabled the frontpage should now load a new message describing the issue on your site. Determining what to do next requires a little more skill however the errors can often be searched on the the Joomla forum; or in the case of errors with Joomlabamboo templates and extensions it is possible to paste the error for us in your support ticket or forum post so we can investigate the issue further.
In the example created for this tutorial the error I received is:

Parse error: syntax error, unexpected $end in /Volumes/Media/sites/qs/17/Newstream/templates/zengridframework/index.php on line 1156
 With this information it is now possible to see the file that is causing the issue and then investigate what is causing the error.