When Push Publishing to Static Endpoint, there are some special considerations, parameters, and configurations that will change the end result of your staticly produced site. To learn how to configure a Static Endpoint properties, please see the Connecting Remote Servers documentation. The image below shows a proper Static Endpoint configuration that includes both the language and date properties.
Note: Static Endpoints are only supported in dotCMS Enterprise editions for customers with a Site License (Platform level license). Please see the list of dotCMS versions for more information on features supported in different version of dotCMS.
Expected Multilingual Static Push Behavior
When the {languageIso}
property is configured on a Static Endpoint, then a separate static site will be created for each language in which mulilingual pages exist. The “en-us”, “es-es”, etc., will be seen within the name of each static bucket, for each page language version. For the default settings to work optimally, each static site (in each language), please refer to the following requirements and recommendations:
- Every page must exist in each language version (Creating pages in only the default language will not create multi-lingual static sites)
- Content must be translated on each page in all languages to avoid blank static pages*.
- URL mapped content pathing will be created, however, do NOT nest URL maps under anotehr page, as they will not work. Example: Do NOT create a page called “news” and then create a pattern with that page in the stem “news/url-title”. Static publishing urlmaps expects /news to be a folder, not a page.
- Static does not care about ?params. When using dotCMS restful image apis and place all args in the uri path and not in ?param
- Always end a restful image call with the filename at the END, e.g.
http://demo.dotcms.com/contentAsset/resize-image/5d021a67-dafa-4244-be12-a3afdc956dd6/image/h/125/pie-chart.png
rather than
http://demo.dotcms.com/contentAsset/resize-image/5d021a67-dafa-4244-be12-a3afdc956dd6/image/h/125
Multilingual Endpoint Naming Strategies
dotCMS supports multiple **prefix strategies” configurations for multilingual static endpoints:
Example 1: dotcms-bucket-mywebsite.com/en-us/my-page.html (example config using bucket prefix- creates a folder for each language under each host bucket)
aws_bucket_name=dotcmscorp-{hostname}
aws_bucket_folder_prefix={languageIso}
or Example 2: dotcms-bucket-en-us-/pages/my-page.html
aws_bucket_name=dotcms-bucket-{languageIso}/pages/
or
Example 3: dotcms-bucket-/en/pages/my-page.html
aws_bucket_name=dotcms-bucket-{languageId}/pages/
Additional variables, such as {languageCountry}, can also be found in the connecting to remote servers documentation.
Endpoint Recommendations
- It is recommended that CDNs be used for common libraries, js, fonts, etc. This will help reduce the amount of local file dependencies for static page rendering.
- Pushing to both static and dynamic push publishing endpoints can be separated into separate environments, depending on your implementation needs. Static and Dynamic endpoints don't need to exist in the same push publishing environment.
Configurable Content Fall Thru Behavior
To avoid *blank static/dynamic pages where all content has not yet been fully translated, a property exists inside the dotmarketing-config.properties file which, if set to true, can trigger the default language version of the content to persist, even if the page has no content translated for the language version of the site being browsed.
DEFAULT_CONTENT_TO_DEFAULT_LANGUAGE=TRUE (Set to FALSE by default)
If this property is set to TRUE, then as long as a secondary language version of the PAGE exists, then the secondary language version of the content on the page will display, ELSE the default language version of the content will display - thereby avoiding blank pages. For example: If the default language is set to English, and a page exists in both English and Spanish, but a piece of content only exists in English, then both the english and spanish static sites will have the page, but on the spanish page, the default english content will display instead of leaving the page blank.
The following image shows to different language versions of the demo site pushed statically, and served, on Amazon AWS services.