Description
Motivation
ERPNext currently supports managing multiple companies/locations under one instance. However, a user can create only one website from such instance. This can be problematic if the companies are unrelated or location-specific strategies need to be implemented.
The proposed solution is to support multiple websites from a single instance. This will increase the flexibility of the software and empower the user to manage all their concerns from a single instance.
Design
Website Settings --> Website
Currently, Website Settings is a single DocType. It will be converted into a non-single Website DocType.
New fields:
-
Website Name (unique, for e.g. Textlocal India, Textlocal UK)
-
Hostnames (Table, for eg. textlocal.in, www.textlocal.in, 12.34.56.78)
-
Current implementation will be modified to check for hostname (
frappe.local.request.host
) and analyse the request based on the specific website the hostname points to. -
A validation will
enforcewarn about at least one hostname per website (if not default website). -
Is Default (Checkbox)
Hostnames not mentioned elsewhere will be directed to the default website. Validation will be used to prevent deletion of default website, and logic will be written to ensure that only one website is default. It might also be a good idea to hide hostnames table, if website is set as default.
-
Website Script (field in 'Website Script' section /
link to Website Script DocType) -
About Us (
linkdeprecate + patch) -
Contact Us (
linkdeprecate + patch)
- [ ] An enahancement for user-defined routes of About and Contact pages might be useful too.
-
Blog Settings (
link /section) -
Portal Settings (link)
-
Homepage (
link, deprecate + patch (erpnext)) -
Shopping Cart Settings (link(erpnext))
Convert to non-single DocType (Patch for existing users)
- [ ] About Us
- [ ] Contact Us
- [ ] Homepage
- Portal Settings ==> Portal
- Shopping Cart Settings ==> Shopping Cart
- [ ] Blog Settings (?)
Website Script (?)
Publish to specified sites
Doctypes involved:
- Web Page
- Web Form
- Blog Post
- Blog Category
- Help Article
- Help Category
Item and Item Group to be managed using Product Catalogue.
Here's my current take on implementing this:
-
Global settings for whether or not you want to publish a specified doctype to only some of the websites.
-
Based on global settings, relevant child tables in Website doctype will become visible/hidden.
-
Based on global settings, a button will be visible/hidden in individual doctypes. Upon clicking the button, a MultiSelectDialog will popup to choose the websites where you want to publish. Additionally, the MultiSelectDialog will also popup upon saving the DocType if "Show in Website" or "Published" is changed to True.
Additional New Features (DocTypes)
- Redirect (301)
- Custom 404 Page
Other Changes
- Tests
- Documentation
- Migration Patches
- Single -> Non single
- Doctype -> Fields
If you reached here, I'd like to thank you for taking the time to read this proposal. Your approval (:+1:), disapproval (:-1:), and comments are much appreciated.
Module Maintainers:
@rmehta, @netchampfaris
Your inputs/approval would be very valuable.
Sponsor:
@parsimonyERP
Special thanks to:
@agritheory