Creating a Menu Item for your Joomla 3 Component
This tutorial series, Joomla 3 component development, is currently in progress...
So far in this tutorial series we've been testing our new component by visiting our Joomla site and adding index.php?option=com_helloworld to the url, as in:
In this tutorial, we will show you how to create a menu item for your component. This will allow you to add a link to your menu that points to your component with a URL similar to:
To create a menu item:
- Decide which view
Components can have multiple views. Decide on which view you want to create a menu item for.
- Go to tmpl folder
Navigate to the tmpl folder of the view you chose in step 1.
- Create default.xml
Create a default.xml file in the tmpl folder with the following text:
<?xml version="1.0" encoding="utf-8"?> <metadata> <layout title="Title"> <message>message</message> </layout> </metadata>
When going through the process of creating a menu item, the Title and message in the code above will be shown in the listing of item types (as in the screenshot to the right):
Testing our new menu item
The whole process thus far of creating a new menu item for our component has been actually quite easy. If everything's not "clicking" yet for you, review the following screenshot (hopefully it'll tie everything together).
‹Section 6: How to add a New Task to your Joomla 3 Component
›Section 8: How to add the default Model to your Joomla 3 component
Joomla Community Google+ Hangout #3
June 3rd, 2014
Thank you @RustyJoomla for letting me speak on the Joomla Community Google+ Hangout!
Support Center LoginOur Login page has moved, Click the button below to be taken to the login page.
2014-12-23 11:15 am
I am new developer Joomla. I visit this site to learn. Your site powerful.