A best practice is a way of working that consistently yields better results. Best practices save time and effort and result in more maintainable projects.
We recommend that you allocate at least 50GB of disk space for an author instance and 25GB for a public instance.
See Disk space
Make the Container instance available in your ContentConnector. This makes it easier to implement item and itemId related methods. This works only if you have only one Container per subapp. If you need more Containers you must decouple the Container and the ContentConnector.
Defining something as a component allows other developers quickly change the implementation. For this reason, you should define anything that is likely to be changed or customized later as a component. For example, define your apps and subapps as components. Views are also common customization points so define the views returned by subapps as components. Any components you define are available for injection. This is also true for components further up the hierarchy in parent components.
The delegating transformer classes should be your first choice since they are the most versatile. If you can, use
DelegatingMultiValueFieldTransformer rather than the other available classes.
See Field validators
With message bundles a translator can work with a plain text file and doesn’t need to touch the code.
Magnolia requires everyone to use UTF-8 character encoding in
Avoid hard-coded strings exposed to visitors, editors or administrators. Always allow localization of texts displayed on the website and in Magnolia Shell.
Create separate message bundles for user interface labels and template labels. Don’t store these two groups of text in the same properties files or message bundles. They are aimed at different audiences and have different localization requirements.
Example: Message files in the Travel Demo
To create a custom Magnolia webapp, always start with a preconfigured Magnolia webapp.
properties section to define versions. The section may the serve as a central part for organizing all versions required by your project.
When you are creating a website project, you should have one module for templates, another module for content, a third for a theme and so on.
In a multisite setup with one Magnolia installation, you assign multiple domains to the public instance. However, it is sufficient and recommended to have only one domain pointing to your author instance. The domain of the author instance is different from the domains of the public instance.
Use different values for the
site-definition-name and the name of the mapped node (
When extending site definitions, turn off inheritance for
domains by using
uri-starts-with-sitename rule in the public context.
Add an additional voter AdminOnlyMatcher to the rule. This way you can use the same configuration on both the author and public instances.
Create a new app group for your own apps, especially if you have multiple apps. This approach is better than placing your apps in the native Magnolia groups. A dedicated group gives your organization’s apps an identity and makes them instantly recognizable.
See App permissions
Provision apps only to users who actually need them. This ensures that the app launcher stays uncluttered and users find apps quickly.
See App permissions
When you store groups in LDAP, create one matching group per role in Magnolia. Assign roles to the group in Magnolia in order to grant users the permissions they need. This minimizes the number of groups you need to create in Magnolia.
See Group resolving
Every trait has inherent allowed values. For example, locations are countries, ages are numbers, and genders are either male or female. Create traits that have a clear set of allowed values. Traits that have vague values are difficult to detect and assign. Also, make sure the trait applies to the majority of your audience. "New vs. returning visitor" is a good trait because the values are easy to detect and it applies to every visitor.
Create a segment only when you know your audience well and have targeted at least one successful campaign to them using local rules. Visitors who share a combination of traits are good candidates for segmentation if they respond well to personalization. For example, add visitors who previously bought a product to a "Previous buyers" segment and offer them a discount as a reward for return business. Segmentation helps you repeat successful personalization experiments. Start with local rules, move to segmentation later.
Do not use tasks if you don’t have any human activity in your workflow. They are great for humans but unnecessary for operations that only involve the system itself.
Configure your content staging instance as a public instance so that users cannot edit pages on it. The Pages app does not display the green edit bars on public instances. You typically don’t want reviewers to change content on the staging instance. While reviewers may need permission to log into the AdminCentral to review functionality such as new apps, they should not edit pages. The staging instance is intended for testing and approving only. If something is not correct, fix it on the author instance and publish again to staging for another test.
See Content staging