Using SEF in Joomla!

Category: Joomla!

If you are using SEF on your Joomla! site, you need to be careful on creating menu links:

SEF URLs are created with help of menu links in Joomla!. Every menu link (e.g. link to component) gets an Itemid (unique ID) and Joomla! can make nice URL with help of this ID.


But links which are included in plugins (in article) or in modules, don't have any menu link, so they don't have any Itemid. It means, links which are created in plugin or module, cannot get nice URL (in case no hack will used).

Mostly there are components which work together with modules and plugins in Joomla!, for example: Phoca Gallery.


If you create menu link to Phoca Gallery component and you are using SEF, then mostly everything is OK and Joomla! will create nice (SEF) URL to the component. But if you are using e.g. Phoca Gallery Image module together with Phoca Gallery component, then one of the feature in module is displaying a link to component (mostly e.g. link to detail view of the component). Because Phoca Gallery Image module is a module, it has no Itemid and cannot create nice URLs, so it tries to find some Itemid in Joomla! system. It tries to find the Itemid of menu link to Phoca Gallery component. If you have created a menu link to Phoca Gallery component and this menu link is published (active), then Phoca Gallery Image module will find this menu link ID (Itemid) and will create SEF link to detail view of component correctly.

Phoca Gallery plugin works the same way. It tries to find some Itemid of Phoca Gallery component and tries to create SEF link correctly.

So if you are using module or plugin which works together with component (e.g. modules and plugins for Phoca Download, Phoca Gallery, etc.) then you need to create menu link to component, so module or plugin can find Itemid of the component menu link and can create the link to component correctly.


What if you don't want to display menu link to component but you want, your modules and your plugins will create SEF links correctly?


Just go to your Menu Manager, create a new menu group and create a menu link to component inside this menu group. There will be an active menu link to component. It means that modules and plugins can find it and can create SEF links correctly. It works but on your site there will be new menu group. And you don't want to display it. Then go to Module Manager and unpublish the module (menu group which you have created is in fact a module). Now the module will be not displayed on the site but the menu link to component is still active because the menu link is published. Modules and Plugins can now create the SEF links correctly. We don't need to publish the module (menu group), it can be unpublished. We only need to have the menu link in this menu group active so the system can find it. It can find it even if the menu group is unpublished (not displayed on the site).



You have installed Phoca Gallery component and Phoca Gallery plugin. You want, your Phoca Gallery plugin will create SEF links to Phoca Gallery component correctly but you don't want to display the menu link to Phoca Gallery component - e.g. to Categories View. So you will go to Menu Manager and you will create new menu group called "Hidden". In this menu group you will create menu link to Phoca Gallery component - e.g. to Categories View. The help link  (SEF menu link) for Phoca Gallery plugin will be created. Now you will go to Module Manager and you will unpublish the module "Hidden" (menu group "Hidden" is displayed on the site as module). Then the SEF links will be correctly displayed and the menu group "Hidden" will be not displayed on the site.


SEF Method to change complicated URLs to nice (partially human readable) URLs
SEF URLs Links (URLs) created by SEF method
Itemid Unique ID for menu links in Joomla!. See article which describes Itemid behaviour in Joomla!
Menu Link Joomla! administration -> Menu -> Main Menu e.g. -> now you are in Menu Item Manager and you can create a menu link e.g. to component (click on New icon)


Articles with similar information:


Powered by Phoca