I can only retrieve the global keywords. Is there a way to retrieve the article's keywords?

I am trying to modify the Administrator template. I want to add each article's keywords to the Articles view page located at (Administrator template: html/com_content/articles/default.php).

Thank you.

    $document = JFactory::getDocument();
    $content = $document->getMetaData('keywords');
    echo $content;
  • It's confusing what you are trying to do. Administrator template, each article keywords to the articles view page ... ?
    – FFrewin
    Commented Nov 15, 2016 at 13:23
  • The page I want to modify can be found at: Administrator Main Menu - > Content - > Articles. This page lists all the articles. I want to display the keywords for each article the same way the Category is listed.
    – Donald Ax
    Commented Nov 15, 2016 at 15:45

2 Answers 2


I finally got it by accessing the database correctly. Here is the code:

//get metakey by id
$db = JFactory::getDbo();
$id = $item->id;
$db->setQuery("SELECT metakey FROM #__content WHERE id='$id'");
$metakey = $db->loadResult();
echo $metakey;

Well, I would look for the possibility of overriding the articles model to add in the query the metakey column and then call $item->metakey in the articles view template, instead of generating db queries for each of the loaded articles.

Actually, because this is a sligth modification, I could even consider to simply do it directly on the core model file and have to maintain this with every update - although not the recommended practice, I might be willing to pay the tribute for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.