I want to get article text by passing article ID from the joomla template.
Get article text by article ID in Joomla 2.5 (3 will work also according docs) plugins:
$article =& JTable::getInstance("content");
$article->load($id);
$content = ''. $article->get("title").'
';
$content .= $article->get("introtext"); // introtext and/or fulltext
And article id is got from component/plugin parameters for example:
From inside own component:
$app = JFactory::getApplication();
$params = $app->getParams();
$param = $params->get('terms_article_id');
From other component:
$params = JComponentHelper::getParams('com_mycom');
$id = $params->get('terms_article_id');
Get Module Parameter from template's php file:
$module = JModuleHelper::getModule('mod_mymodule');
$params = new JRegistry($module->params); // or $mymoduleParams if few used
$id = (int) $headLineParams['count'];