-
Notifications
You must be signed in to change notification settings - Fork 30
003. Adding a menu type to the site part
In this article we will cover how to add a menu item to a basic Joomla! component.
Now, for something a bit different on the front end, we need to create a xml
file that will be used by Joomla! to allow us to create menu items that point to this view. Later on we will use parameters for this menu item. But for now, we will just keep it simple. We add some language strings for text. Later we will see, how we can translate this strings.
Newly created files
components/com_foos/tmpl/foo/default.xml
Modified files
administrator/components/com_foos/foos.xml
Click here to see all changes compared to the last chapter
components/com_foos/tmpl/foo/default.xml
We need to modify our installation XML file, the update server and the change log to include the new version.
administrator/components/com_foos/foos.xml
Now you can zip all files and install them via Joomla Extension Manager. After the installation, you are able to create a menu item in the menu manager. Now you can see the view in the front using a menu item. In the front end you can see the menu item and you can open the front end view with the help of the menu item.
Now we are able to add a Menu Item to our component. This will allow us to access our component a menu item rather than having to remember what to type into the address bar. Currently the view does not show any data yet. In order to work with data, we will add a model to our component in the next chapter.