use "alias"-description when type is "menulink"

Your code modifications and patches you want to share with others.
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Thu Dec 29, 2005 8:31 pm

use "alias"-description when type is "menulink"

Post by avdkooij » Mon May 03, 2010 7:54 pm

I have 2 menuitems:

Itemid=26, alias=news, type=component, link=index.php?option=com_content&view=category&layout=blog&id=58
Itemid=27, alias=latestnews, type=menulink, link=index.php?Itemid=26

- So in my menu's, both buttons point to a bloglayout of category 58
- If i change something in Itemid 26, then the other changes too.

My problem is:
I can use the alias of Itemid 26:
But i cannot use the alias of Itemid 27... ( don't works :-\ )

A 404 error ('component not found') error is raised by componenthelper::rendercomponent() in www/libraries/joomla/application/component/helper.php:95

Code: Select all

function renderComponent($name = null, $params = array())
		global $mainframe, $option;

		if(empty($name)) {
			// Throw 404 if no component
			JError::raiseError(404, JText::_("Component Not Found"));
So, $name is empty and i think this it caused by the fact that their is no "option" specified in the link of Itemid 27.
(At menuitems of the type 'menulink', the menu-manager puts a value with format 'index.php?Itemid=xx' in the link-field.)

So, during the dispatch/parsing of a request, i want joomla to check whether the value of 'link' contains a full (internal) URI or an part of an internal URI (in this case index.php?Itemid=26). If its only a part, it should redirect to the link, e.g. $mainframe->redirect('index.php?Itemid=26');

Where is the best place to perform this check and do the redirect?
Or can i find the solution some (i have searched a lot but couldn't find something well fitting)


Return to “Core Hacks and Patches”