I have developed on simple plugin in Joomla 1.6 I stuck at : How to get article title and article url.
I am getting no output if tried to print below statement:
echo $article->title;
echo $article->id;
I have written this in php file, not used MVC architecture. Is there any other settings need to do in Joomla admin side ?
Please suggest your pointers for extracting article title and article url.
Thanks in advance!
Pravin
In order to get the article ID you have to write the following:
echo JRequest::getVar('id');
For the title, you just take the id you got, load the article object
$blabla = $article->load(ID);
echo $blabla->get('title');
It seems JRequest
is deprecated in 2.5 & 3.x as indicated in the Deprecated Elements list.
I would rather use the following:
$article_id = JFactory::getApplication()->input->get('id');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With