Introduction
Welcome to our detailed guide on customizing document types in Empress. This guide will provide you with an in-depth look at the Naming, Form Layout, and Permissions feature within the Empress platform. These features are critical for developers as they allow for customization, role-based access control, and a more intuitive user experience.
Section 1: Naming
In Empress, the default name
value of a document is a randomly generated hash. However, a more human-friendly approach is to change the name
of the document to the Article Name that we provide. This can be achieved by modifying the Auto Name field in the doctype list.
- Open the doctype list from the search bar and click on Article.
- Scroll down to the Naming section.
- In the Auto Name field, enter
field:article_name
. - Click on Save.
Now, when you create a new Article, the name
of the document will be the Article Name, and it must be unique across Articles. You cannot create another article with the same name.
You can also review the database records by running a select query in the MariaDB console. The following code snippet shows how you can do this:
MariaDB [_ad03fa1a016ca1c4]> select * from tabArticle;
This change ensures that each article has a unique, human-readable name, making it easier to manage and organize your data.
Section 2: Form Layout
Another aspect of customization is the layout of the fields in the form. A well-organized form layout can enhance the user experience and improve data input efficiency.
- Go to the Article doctype.
- Scroll to the Fields section.
- Add two new fields of type
Column Break
andSection Break
. - Hide the Image field as it is not needed to be shown in the form.
Additionally, you can also configure the Form Settings:
- Go to the Article doctype.
- Scroll down to the
Form Settings
section. - Enter
image
in the Image Field. This will display the image at the left top of the form. - Enable
Allow Rename
to allow renaming of documents.
By customizing the form layout and settings, you provide your users with a more intuitive and efficient data entry experience.
Section 3: Permissions
Finally, Empress provides you with the ability to configure roles and permissions for a DocType. This allows you to control access to certain functionalities based on the user’s role.
- Go to the Article doctype.
- Scroll down to the
Permission Rules
section. - Add the roles. For example, you can add a
Librarian
role that has permission for all actions and aLibrary Member
role that has permission forRead
action.
By configuring roles and permissions, you can ensure that users have access to only the features they need, enhancing system security and user experience.
Conclusion
The Naming, Form Layout, and Permissions features of Empress are powerful tools for developers. They allow for customization, role-based access control, and a more intuitive user experience, enabling you to develop business solutions tailored to your specific needs. By taking advantage of these features, you can ensure that your software solution is efficient, secure, and user-friendly.