Naming Convention
In the base theme, the following naming conventions are used:-
Directory & File name (kebab-case): If you want to create a directory with the name “cms library,” you would use kebab case, resulting in “cms-library”. Examples:
text-input.tsx,common-components, -
Component (PascalCase): When creating a component, the name should be in PascalCase. For example, if you want to create a component named “exp zig zag banner” it would be written as
ExpZigZagBanner.
Key Aspects to Consider
When creating a component forcms-library or e-commerce in the base theme, you can follow the directory structure as explained in the Folder Structure documentation. Let’s consider the example of the zig-zag-banner component:
Step 1 - Navigate to the cms-library directory in the src folder.
Step 2 - Create a new folder named zig-zag-banner using kebab case.
Step 3 - Inside the zig-zag-banner folder, create a component file named zig-zag-banner.tsx. This file will contain the JSX code for the component.
zig-zag-banner-controller.tsx within the zig-zag-banner folder. This file will handle the business logic of the component.
index.ts file within the zig-zag-banner folder. This file will import the component file and export it.
zig-zag-banner component in the index.ts file located in the components directory.
Built-in Services and Fields
Experro not only offers its users with convenient services but also provides built-in features and input fields that greatly improve performance and enhance code. For instance, there are tools likeExpCustomImagerendrer, ExpLinkParser specifically designed to assist with image rendering and handling various types of links, regardless of whether they are internal or external. These tools can be seamlessly integrated into your projects, making them easier to manage and ensuring optimal results.