Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

003. Adding a menu type to the site part

Astrid edited this page Jan 3, 2020 · 6 revisions

Adding a menu type to the site part

In this chapter we will ...

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.

t_3_3

t_3_2

t_3_1

Newly created or Modified files

Newly created files

components/com_foos/tmpl/foo/default.xml

Modified files

administrator/components/com_foos/foos.xml

changelog.xml

foo_update.xml

All changes at a glance

Click here to see all changes compared to the last chapter

More detailed explanations

File Structure

Newly created files

components/com_foos/tmpl/foo/default.xml

Modified files

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

changelog.xml

foo_update.xml

Example in Joomla 4

Side Note

Test your component

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.

Concluding Remark

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.

Overview of all files