I need a Hidden field where i retrieve the content, probably ?? How to?
Forums
How do i send the content of my article where my Chronoforms module is embeded in ?
https://joomla.stackexchange.com/questions/19409/how-can-i-show-the-published-date-of-the-current-article-inside-a-module
Get the details with PHP, and THEN display the form. Use {var:php_block_name} in the Value of your hidden field.
Get the details with PHP, and THEN display the form. Use {var:php_block_name} in the Value of your hidden field.
Thank you so much! here is the code for those who need it :
// FIRSTLY CHECK THAT THE PAGE THE MODULE APPEARS ON IS AN ARTICLE
$nameofcomponent = JRequest::getVar('option');
$viewofcomponent = JRequest::getVar('view');
if ($nameofcomponent=="com_content" && $viewofcomponent=="article" ) {
// IT IS AN ARTICLE, SO GET THE ID OF THE ARTICLE
$idofarticle = JRequest::getInt('id');
// LOAD THE MODEL OF COM_CONTENT
$model = JModelLegacy::getInstance('Article', 'ContentModel');
// USE THE GETITEM FUNCTION OF THE MODEL TO RETURN THE DETAILS
$article = $model->getItem($idofarticle);
// GET THE CONTENT TEXT
$content = $article->introtext;
return $content ;
}
// FIRSTLY CHECK THAT THE PAGE THE MODULE APPEARS ON IS AN ARTICLE
$nameofcomponent = JRequest::getVar('option');
$viewofcomponent = JRequest::getVar('view');
if ($nameofcomponent=="com_content" && $viewofcomponent=="article" ) {
// IT IS AN ARTICLE, SO GET THE ID OF THE ARTICLE
$idofarticle = JRequest::getInt('id');
// LOAD THE MODEL OF COM_CONTENT
$model = JModelLegacy::getInstance('Article', 'ContentModel');
// USE THE GETITEM FUNCTION OF THE MODEL TO RETURN THE DETAILS
$article = $model->getItem($idofarticle);
// GET THE CONTENT TEXT
$content = $article->introtext;
return $content ;
}
This topic is locked and no more replies can be posted.