I am trying to implement a menu in joomla 1.5 which should be visible only for guest user not for registered user.
For that I made changes in two files, those are administrator/components/com_menus/models/metadata/component.xml
and
modules/mod_mainmenu/helper.php
For the first file, I have added the following code in the line no 20:
<param name="show_to_guest_only" type="radio" default="0" label="Show to Guest only" description="Show menu to guest user only.">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
And for the second file, I have added the following pieces of code just before the line no 50:
$row_params = new JParameter($row->params);
if ($row_params->get('show_to_guest_only') == 1 && $user->id ){
continue;
}
But after doing this also, I am not getting the expected result.
Can you please help me how to solve this issue.
Thanks in advance.
You shouldn’t hack the core files. If nothing else copy mod_mainmenu to another name like mod_guestmenu and then do your changes there and installing.
You might want to use one of the advanced module management extensions available at extensions.joomla.org
MetaMod is one that springs to mind.