Joomla 1.5-Creating Raw Output for the front end

Published: 04th July 2010
Views: N/A

Raw Output In Joomla!
Joomla 1.5-Creating Raw Output for the front end

If you want your component to create RAW output on the front end, like xml data to be returned for an AJAX POST/GET, then this is what you have to do.

1. In your component's views/view/ folder, add a view.raw.php file. E.g. if your component has a view called smile your will add view.raw.php to your views/smile/ folder . i.e. com_mycomponent/views/smile/view.raw.php

2. Whenever you call your component via a url simply append format=raw to the url. E.g. index.php?option=com_mycomponent&format=raw

Notes: For the backend administrator side, you can just specify format=raw without having to add the view.raw.php file to your views folder.

Understanding Output Overrides in "Joomla!" 1.5

Written by Andrew Eddie
Introduction

There are many competing requirements for web designers ranging from accessibility to legislative to personal preferences. Rather than trying to over-parameterise views, or trying to aim for some sort of line of best fit, or, worse, sticking its head in the sand, "Joomla!" has added the potential for the designer to take over control of virtually all of the output that is generated.

"Joomla!" has been criticized by some for not giving due attention to accessibility or being archaic in their approach to web standards. However, with 1.5, the responsibility -- and, more importantly, the power -- to control output is back in the designer's hands.

In addition, except for files that are provided in the "Joomla!" distribution itself, these methods for customisation eliminate the need for designers and developers to "hack" core files that could change when the site is updated to a new version. Because they are contained within the template, they can be deployed to the Web site without having to worry about changes being accidentally overwritten when your System Administrator upgrades the site.

The aim of this tutorial is to introduce the how fours areas of the output of "Joomla!" are able to be customised by the template designer.

Not interested in all the theory? Jump straight to the cheat sheet.
related websites: http://joomlaextensiondevelopment.com/raw-output-joomla.html, http://www.joomlacomponentdevelopment.com, http://joomlatemplatecustomization.com

Report this article Ask About This Article


Loading...
More to Explore