-
Notifications
You must be signed in to change notification settings - Fork 30
012. Adding categories
Now, we want to add a categorie.
Newly created files
administrator/components/com_foos/sql/updates/mysql/1.12.0.sql
Modified files
administrator/components/com_foos/Extension/FoosComponent.php
administrator/components/com_foos/Model/FoosModel.php
administrator/components/com_foos/access.xml
administrator/components/com_foos/foos.xml
administrator/components/com_foos/forms/foo.xml
administrator/components/com_foos/services/provider.php
administrator/components/com_foos/tmpl/foo/edit.php
administrator/components/com_foos/tmpl/foos/default.php
Click here to see all changes compared to the last chapter
Now you can zip all files and install them via Joomla Extension Manager. After that you can see a link to your component in the left side menu. Clicking on this link will open the basic backend view.
Now we have . Up to now we have no . We are going to work on this in the next chapter.
You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha11-dev)
The administrator/components/com_foos/Model/FoosModel.php file is ....
The code for the administrator/components/com_foos/Model/FoosModel.php file is as follows:
The administrator/components/com_foos/access.xml file is ....
The code for the administrator/components/com_foos/access.xml file is as follows:
The administrator/components/com_foos/foos.xml file is ....
The code for the administrator/components/com_foos/foos.xml file is as follows:
The administrator/components/com_foos/forms/foo.xml file is ....
The code for the administrator/components/com_foos/forms/foo.xml file is as follows:
The administrator/components/com_foos/tmpl/foo/edit.php file is ....
The code for the administrator/components/com_foos/tmpl/foo/edit.php file is as follows:
The administrator/components/com_foos/tmpl/foos/default.php file is ....
The code for the administrator/components/com_foos/tmpl/foos/default.php file is as follows:
Now you can zip all files and install them via Joomla Extension Manager.
You have to run a new installation or fix the database due to the changes in the database.
After that you can
It would be good, to set a default categorie while installing your component. You can do this in the file script.php
In the sidebar you now see another menu item. With this menu item you can create categories for your extension.
You can select this category when editing an item.
If a category is assigned, it will be displayed in the overview.
You can now classify the items into categories. Next, we'll look at how to change the state of an item. Next