Skip to content

Instantly share code, notes, and snippets.

@2dpi
Created June 29, 2013 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2dpi/5890113 to your computer and use it in GitHub Desktop.
Save 2dpi/5890113 to your computer and use it in GitHub Desktop.
SQL: joomla tag title output
<?php
// Initialiase variables.
$db = JFactory::getDbo();
foreach ($item->getValue('art_tags') as $key => $tag) {
if ($key >= 0) {
// Use following line in a model.
$query.$key = $db->getQuery(true);
// Prepare query.
$query.$key->select('u.id,u.parent_id,u.path,u.title');
$query.$key->from('#__tags As u');
$query.$key->where('u.id='.$db->quote($tag));
// Inject the query and load the result.
$result.$key = $db->setQuery($query.$key)->loadRow();
//print_r($result.$key);
// Format Output
echo '<span class="tag">'.$result.$key[3].'</span>';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment