Content (CMS)

Last modified by Denis Pavlov on 2018/06/17 08:29

CMS
CMS Overview
  Play 15:33

Overview

Content management system (CMS) allows to enrich e-commerce website with business driven content. Generally speaking this enrichment encompasses the following functions:

  • Creation of content pages
  • Creation of content includes (chunks of pages to be used in templates of a theme used by shop)

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.

Page

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

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:

  • Grouping content in admin for better management
  • Creating a logical root of hierarchy (i.e. include content object can have public content objects children thus creating a public content branch, effectively a microsite section)
  • Theme template includes - predefined zones in theme templates that allow configuration of page elements (e.g. meganav, footer, cart page configurable elements)

External CMS

YC 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:

  • Plug into the YC content service layer (via custom content service adapter) to retrieve content from their systems. 
  • Use external CMS as their primary website engine and then use YC REST API as data processing engine bypassing content and themes altogether.

Content management

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.

yc-3.5.0-content-overview.png

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

SEO tab allows full control over locale specific settings. Options allow to manipulate URI and meta tags.

yc-3.5.0-content-seo.png

Content body

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.

yc-3.5.0-content-body.png

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.

WYSIWYG

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.

yc-3.5.0-content-wysiwyg.png

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 YCE 3.5.0+

CMS Media Management
  Play 5:57

Media repository is YCE 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.

yc-3.5.0-content-fm.png

Using functions

  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. 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:

FunctionParam 1Param 2ExampleDescription
includeuri 
${include('license')}
Allows to include body of another content by URI reference
contentURL *uri 
<a href="${contentURL('license')}">License page</a>
Generates a link to content by its URI
categoryURL *uri 
<a href="${categoryURL('notebooks')}">Notebooks</a>
Generates a link to category by its URI
productURL *uri 
<a href="${productURL('158')}">TS-231 + 2X ST2000VN001</a>
Generates a link to product by its URI
skuURL *uri 
<a href="${skuURL('82')}">ME181C-A1-WT</a>
Generates a link to SKU (a specific variant of product) by its URI
URL *uri 
<a href="${URL('')}">Home</a>
Generates a link

* 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 YCE

URL include is an advanced feature of YCE 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&param2=value2</script>

This feature is not the same as include function from dynocontent template and serves a multitude of purposes.

  • include function runs within scope of content it was called from (i.e. like a script). So all parameters that are passed to included content are exactly the same and thus there is a dependency on the parameter input in included. On the contrast url includes run in a separate server side sub request and allows to pass additional parameters (e.g. param1 and param2 in the example above). There is no limit on the parameters but only simple types can be passed (i.e. not objects) but plain text
  • url includes do not depend on dynocontent and thus can be included in any content anywhere thus allowing to embed custom components. For example if you developed an element such as featured product gallery, on internal controller "/internal/productgalery", which accepts a list of product SKU, then this component can be embedded anywhere in content by reference <script type='yc-include'>/internal/productgalery?sku=SKU_A|SKU_B|SKU_C</script> and therefore any such gallery can be placed in any content by simply including one line. See featured products sliders on demo http://edemo.yes-cart.org which use this concept, the same component is included several times with list of SKU to generate different sliders of complete product pods
  • lastly url includes allow to fine tune page caching (a feature) or SFG implementation that boosts performance enormously by caching chunks of generated HTML for given URI

Groovy scripts

  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

 

Tags:
Created by Vladyslav Pavlov on 2018/05/31 09:14
    
YesCart.org © 2009 - 2018
v.1.0.0