Joomla! 1.5 Find Section Name PHP Function
May 1st, 2009 Jonathan Harriot expand/collapse this entryOn a recent project I was forced into using Joomla! 1.5. Joomla! is nothing to be excited about unless you like a bloated, non-user friendly CMS which has to my knowledge no clean code. Thank God for WordPress, but I digress.
I prefer to use server side code to display static elements such as a Flash object or video playlists for the homepage but to accomplish this with Joomla requires the user to create a module and blah blah blah.
For brevity’s sake I created a simple function to evaluate the current page’s section name
The Function:
function sectionName($pName) {
if (JRequest::getVar('view') == $pName)
return true;
else
return false;
}
Sample Usage:
if (sectionName(frontpage)) {
echo ("You are home");
}
Although Joomla is the anti-Christ of Content Management Systems you can make it work for you in bits & pieces.
Posted in i came as a rant, jQuery, php, web accessiblity | 1 Comment