Page 1 of 1

Getting Page name

Posted: Sun Sep 23, 2007 7:12 pm
by Smav
Hi there,

I am new to joomla and PHP, but have extensive experience in ASP.net.  I would like to know how to simply output the page name, or the "itemid" to the page, so that I can input it into a flash movie i am using for the menu on my site.

Can any brave soldier assist me with this?

Also, one of the things i did like about .net was the extensive documentation and samples that were packaged with it (.net 2.0 SDK documentation).  The .net documentation, outlines all of the commands you could use in C# as well as examples of usage. Can someone tell me if i can download such a thing for PHP, or access a website that will provide me with this data?

Thanx,

Gavan

Re: Getting Page name

Posted: Sun Sep 23, 2007 7:41 pm
by ianmac
Head over to php.net for a reference of the PHP language.

To get the pagename, you do:

Code: Select all

$document =& JFactory::getDocument();
echo $document->getTitle();


Ian

Re: Getting Page name

Posted: Sun Sep 23, 2007 8:28 pm
by Smav
Thanx Ian,

Much appreciated

Re: Getting Page name

Posted: Sun Sep 23, 2007 8:43 pm
by Smav
I'm getting an error: "Fatal error: Class 'JFactory' not found in C:\sites\premium6\lomaxgroup\webroot\joomla\templates\lomaxgroup\index.php on line 29"

I assume i have to include and/or install the JFactory Library, How do I do this?

Re: Getting Page name

Posted: Sun Sep 23, 2007 9:02 pm
by Smav
I guess i should have stated that i have 1.0 installed.

Re: Getting Page name

Posted: Sun Sep 23, 2007 9:06 pm
by tjay
Most likely your missing and include
this is at the top of content.php component

defined('_JEXEC') or die();

jimport('joomla.application.component.controller');

Re: Getting Page name

Posted: Sun Sep 23, 2007 9:08 pm
by tjay
Ah your in the wrong forum

this is 1.5 coding 101