Content management system (CMS) allows to enrich e-commerce website with business driven content. Generally speaking this enrichment encompasses the following functions:
CMS allows to create micro sites as well create navigation menus, promotion banners, customer messaging, which are specific to each shop instance. Each content object can belong only to a single shop.
Whenever a new shop instance is created CMS section of admin is populated with an entry to access the root content object of the specific shop instance. Child content objects can be attached to this root with child content objects of their own to form content hierarchies with unlimited level of depth.
The layout of the content page is determined by theme's content page template. Most commonly these templates include a fixed structure with header, body section and footer. The body of the content object is inserted into the body section. Template is resolved from the content template configuration of content object. Default theme defines two of such templates: content and dynocontent which use content body as plain HTML and HTML with groovy scripts respectively.
However custom theme implementation can define its own content templates, which could use more complex rendering of pages.
Include refers to a special content template configuration include. The purpose of include is to specify internal content objects that are private (i.e. not available on storefront).
Main use cases are:
The platform content service engine does not force business users to use built in CMS. Users that have existing CMS (e.g. Alfresco, Adobe CMS) have two integration options:
CMS management is focused at managing content for a specific shop at a time.
There is option of browsing the content hierarchy of a shop or search using keywords. Search filter can also accept special characters that instruct search to behave in a certain way (e.g. prefixing search with ^ would result in displaying content matching the search keyword and its immediate children). Use the help button on filter to see more options available for searching.
Content object editor has a number of tabs each containing function specific configurations.
Mian tab allows to move content in the hierarchy by changing the parent (more details on setting up hierarchies are in this cookbook). Also content availability options can be set either temporal or by toggling disabled flag. Only available content will be publicly visible on frontend.
Localisation contains settings for content name that is displayed in menus and breadcrumbs.
Templates tab contains content template that defines how the content body is used.
Templates * | Accessible via URL | Rendering |
---|---|---|
content | Basic layout of web page with content menu. Content body fills the middle section of the page | |
dynocontent | Dynamic content is enhanced version of "content" that treats content body as template that can contain variables and call custom functions. Variables available to template depend on the theme. | |
include | Content which is non accessible via public URL used to fill in placeholders in web pages defined by theme. Another usage is splitting content hierarchies into sub hierarchies for purpose of better content management in YUM and creation of distinct microsites. |
* Custom themes can include other templates for alternative render process
SEO - search optimisation engine configurations.
CMS - actual content that is used according to template configuration
Attributes/Images tag - for additional configurations that can be used by this content object
SEO tab allows full control over locale specific settings. Options allow to manipulate URI and meta tags.
Content body is optional and is reserved only for content objects that render content on storefront. Typically these are content pages and content includes that are defined by templates.
At the top of the tab are locale toggle buttons. These buttons do not disable locales, they are used to show/hide language blocks to make this screen a bit more manageable when working with large content bodies (to enable/disable shop locales see shop configurations).
Each language block has a heading bar with three tools: WYSIWYG editor, raw editor and preview. In addition to this it contains a language label that is either green (for non empty content body) or red (for empty content body). This is useful when content body does not contain visible element (e.g. scripts or meta tags).
Lower section of the content block shows a preview but it differs from the actual design. In order to see this body as it would be visible in shop you must use preview tool. This tool includes the yc-preview.css that contains full CSS bundle of the theme and thus will display HTML as closely as possible to the end result. Because preview tool opens in a new window you can also resize it to see responsive design in action.
Raw data editor allows raw source manipulation and is intended for use by professional web designers in order to fine tune design and add non standard attributes that may be used by JavaScript functions or other external tools such as Google tag manager or other analytics engines.
WYSIWYG editor is intended for use by business users and has advanced features to allow user friendly web design experience. Insert template function allows to insert predefined responsive templates to arrange blocks of HTML. User should familiarise with hot keys and tips that can be viewed using help button in the editor.
By default this editor has Show block borders toggled, which draws a dotted line around blocks of HTML (e.g. div, p, pre). This allows to visualise blocks of HTML and how they behave when size of screen changes. Green indicates desktop size, blue - tables and red - mobile.
Editor is displayed in a separate window, so it can be resized at any point to visualise how HTML reacts to different view ports.
Note that working with blocks ENTER key creates a new line within each block. Thus to escape out of the block to add new one use hot key "SHIFT+ENTER". Use help button to view full list of shortcuts and tips. |
Media repository is integration for CMS WYSIWYG editor that allows to browse uploaded media files. In open source version only files and images that are attached as attributes to specific content objects can be used by copying generated URI. This integration allows to upload media unrelated to data objects and also browse and select it from WYSIWYG.
We strongly recommend using only raw editor for content that uses functions or scripts |
If you recall in content template configurations we had an option of using dynocontent. This type of template is an advanced version of content template that treats the body not just as plain HTML but as a mix of HTML and Groovy script and/or Thymeleaf template. This enables use of predefined functions and also some advanced scripting in the content to make the content dynamic (i.e. enriched with server side data, such as product details, category details, cart details etc).
The following built in functions are available in core code:
Version | Function | Param | Example | Description | |
---|---|---|---|---|---|
1.x.x | include | uri |
| Allows to include body of another content by URI reference | |
1.x.x | contentURL * | uri |
| Generates a link to content by its URI | |
1.x.x | categoryURL * | uri |
| Generates a link to category by its URI | |
1.x.x | productURL * | uri { fc, uri } 3.7.0+ |
| Generates a link to product by its URI will also include filtered navigation path | |
1.x.x | skuURL * | uri { fc, uri } 3.7.0+ |
| Generates a link to SKU (a specific variant of product) by its URI will also include filtered navigation path | |
1.x.x | URL * | uri |
| Generates a link | |
3.7.0+ | encodeURI | uri |
| URL encode a parameter | |
3.7.0+ | decodeURI | uri |
| URL decode a parameter | |
3.7.0+ | filteredURL | uri |
| filtered navigation path |
* It is not necessary to use functions for links, you can simply use <a href="/category/notebooks">Notebooks</a> instead of <a href="${categoryURL('notebooks')}">Notebooks</a>. However functions become useful when you have multiple environments and some of them are not running from root (e.g. www.mydomain.com) but from a sub root (www.mydomain.com/yes-shop). In such setups above stated functions will automatically resolve "/yes-shop" and prepend it to all generated URLs
For technical users: custom functions can be injected into ContentServiceTemplateSupport through registerFunction so you can add your own functions when customising content service API |
URL include is an advanced feature of CMS rendering. It allows to include any arbitrary content by referencing it inside script tag of type yd-include. For example:
<script type='yc-include'>/internal/custom/controller/?param1=value1¶m2=value2</script> |
This feature is not the same as include function from dynocontent template and serves a multitude of purposes.
We strongly recommend using only raw editor for content that uses functions or scripts |
Scripting is beyond the scope of this overview, see this cookbook for more technical in-depth details
We strongly recommend using only raw editor for content that uses functions or scripts |
Thymeleaf templates is beyond the scope of this overview, see official documentation for more technical in-depth details
CMS API exposed via service layer (namely ContentService) that provides an interface for all other services that are dealing with views. Therefore it possible to override content service provider in order to customise the CMS whether to use custom implementation or to use this service as proxy to external CMS.
Sinceit is possible to configure CMS provider via configuration. Your custom modules can be injected via extension points and then activated via system configurations (System > Configurations).
For example use of CMS.v3 can be configured like so:
CMS.contentService=contentServiceCMS3 CMS.dtoContentService=dtoContentServiceCMS3 CMS.contentFileNameStrategy=contentCMS3FileNameStrategy CMS.contentImageNameStrategy=contentCMS3ImageNameStrategy |
Using legacy CMS.v1 can be configured like so:
CMS.contentService=contentServiceCMS1 CMS.dtoContentService=dtoContentServiceCMS1 CMS.contentFileNameStrategy=contentCMS1FileNameStrategy CMS.contentImageNameStrategy=contentCMS1ImageNameStrategy |