Skip to content

Instantly share code, notes, and snippets.

View araneta's full-sized avatar

araneta

View GitHub Profile
@araneta
araneta / gist:2570f66422af7b1197b8
Created May 11, 2014 12:40
Joomla: get article by article id
$db = &JFactory::getDBO();
$sql = "SELECT introtext FROM #__content WHERE id = ".intval($articleId);
$db->setQuery($sql);
$fullArticle = $db->loadResult();
if(!strlen(trim($fullArticle)))
  $fullArticle = "Article is empty ";
@araneta
araneta / gist:65dfb27dff65e9bb100e
Created May 11, 2014 12:39
Joomla: get current (absolute) url
$uri = &JURI::getInstance();
$myabsoluteurl = $uri->toString(array('path'));
@araneta
araneta / gist:072fc3676a63ac14c7a0
Created May 11, 2014 12:34
Joomla: Get Menu Parameter of active menu
$app = JFactory::getApplication();
$menuitem = $app->getMenu()->getActive(); // get the active item
$params = $menuitem->params; // get the params