I am using CMS Joomla 3.x. I have SEO. I am also redirecting the URL to hide article ids, categories, and categories. Therefore, a typical article with the alias my-alias will have the URL: http://localhost/my-alias . I do this routing in the system plugin in the onAfterInitialise() method. All aliases in the system are guaranteed to be unique. Now, when you are browsing through an article, everyone with access will see the edit URL as follows: http://localhost/my-alias?task=article.edit&return=someValidToken . This is also correctly directed to the actual article that needs to be edited.
When viewing an article, the user / browser does not see the article identifier (optional). When editing, the user / browser sees the article identifier (not what I want). That is, when the user clicks on the edit link, the browser loads the edit form and the user sees the following URL: http://localhost/edit-article?view=form&layout=edit&a_id=1002&return=someValidToken , where 1002 is the article identifier.
The following is a snippet of code from onAfterInitialise() :
if (isset($query['task']) && $query['task']=='article.edit') { // TODO Hide this change from the user/browser JFactory::getApplication()->input->set('view', 'form'); JFactory::getApplication()->input->set('layout', 'edit'); JFactory::getApplication()->input->set('a_id', $articleId); } else { JFactory::getApplication()->input->set('option', 'com_content'); JFactory::getApplication()->input->set('view', 'article'); JFactory::getApplication()->input->set('id', $articleId); } JFactory::getApplication()->input->set('Itemid', 111); // map to dummy item in hidden menu with alias edit-article
I would like to know how to solve this. Understanding the call flow through the Joomla framework will help.
source share