Hey everyone -
Wanted to take a moment and share a fix that Max was kind enough to help me with.
Situation: I needed to include the article's title into my form. The form is called via the plugin, and I wanted to know which article the form was coming from.
After some research, found this code to pull in the article's title and pass it through the form data. Hope this helps someone.
Wanted to take a moment and share a fix that Max was kind enough to help me with.
Situation: I needed to include the article's title into my form. The form is called via the plugin, and I wanted to know which article the form was coming from.
After some research, found this code to pull in the article's title and pass it through the form data. Hope this helps someone.
<?php
$input = JFactory::getApplication()->input;
$id = $input->getInt('id'); //get the article ID
$article = JTable::getInstance('content');
$article->load($id);
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $article->get('title') ?>' />