What Is Key Reference Anyway?

You may have noticed the Key Reference parameter under Parameters (Advanced) when creating or editing an article. Most people ignore it since they’re not sure what it’s for.

You may not know it, but if you have clicked a Help icon on any of the Administrator pages, you are using the Key Reference feature.

Typically, when you reference an article in Joomla, you pass the article’s id, which tells Joomla what article to load. Instead of using the id, you can use the Key Reference field. index.php?option=com_content&view=article&id=5&Itemid=2 is what a typical URL looks like.

In the installation sample data, article ID 5 is the Joomla! License Guidelines. Figure D-1 shows the Key Reference field for our article. We entered license in the text box and saved it.

Article–Parameters (Advanced): Key Reference

Figure D-1. Article–Parameters (Advanced): Key Reference

Now we go to index.php?option=com_content&view=article&Itemid=2&task=findkey&keyref=license to access the page.

The two new parameters in the URL are:

task=findkey

By setting task to findkey, you are telling Joomla to look for a keyref parameter and load that article.

keyref=license

By setting keyref to license, you are telling Joomla to load the article that has a Key Reference of license.

You may be asking yourself, “Why you would I want to do this?” The Joomla Administrator Backend uses Key Reference, so we’ll use that in our example. ...

Get Using Joomla now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.