The basic flow is to initiate page rendering by ID via renderPage(String, String) or renderPage(String, Map, String). This will trigger page rendering from a top level perspective, i.e. the page serves as entry point and root container of components. As a related page or component template will likely want to trigger rendering of nested components within its regions it can do this by first fetching the desired region by ID via Page.getRegion(String) or Component.getRegion(String) and then call to renderRegion(Region, RegionRenderSettings) with the recently retrieved region (and optionally provide RegionRenderSettings for customized rendering of region and component wrapper elements).
Various attributes required for rendering in the corresponding template can be accessed with the accordant methods of Page and Component.
Initialize the custom editor of given type id using the passed configuration.
Renders a region by triggering rendering of all visible components within this region.
Renders a region by triggering rendering of all visible components within this region.
Initialize the custom editor of given type id using the passed configuration. The initialization
will trigger the init
function of the respective custom editor type for which the passed
custom editor object is being preinitialized with the given configuration (similar to what would
happen through the editor_definition
reference by any component type attribute definition).
This method is useful to obtain any custom editor instance you want to reuse within the init
method of another custom editor, e.g. as dependent breakout element.
null
is returned.
The layer 1 remote include is what is returned when calling this method.
The provided parameters
argument is passed through till the layer 2 remote include which does the actual rendering so that it will be available
for the render
function of the invoked page as part of PageScriptContext.getRenderParameters(). You probably want to
provide caller parameters from the outside in shape of a json String to the inside of the page rendering, e.g. to loop through query parameters.
The layer 2 remote include performs the rendering of the page and all its nested components within one request. Thus data sharing between the page and its nested components can happen in scope of this request.
The rendering of a page invokes the render
function of the respective page type.
String : render( PageScriptContext context)
The return value of the render
function finally represents the markup produced by this page type.Nesting of renderPage(String, String), i.e. rendering a page within a page (or respectively its components), is not a supported use case.
Due to the nature of the remote includes mentioned above this comes with the url length restriction as you already know it from
remote includes you implement by hand within your templates. Thus the size of the parameters
parameter of this
method has a length limitation accordingly because it just translates into a url parameter of the aforementioned remote includes.
As a best practice refrain from passing complex objects (e.g. full blown product models) but keep it rather slim (e.g. only product IDs).
null
dynamic_lookup
property defined which contains the aspect attribute alias. The aspect attribute value lookup then happens by taking
this aspect attribute alias and using it as attribute identifier within the given map of aspect attributes.
Due to the nature of using remote includes, also see renderPage(String, String), this comes with the url length
restriction as you already know it from remote includes you implement by hand within your templates. Thus the size of both the
aspectAttributes
(keys and values) as well as the parameters
parameter of this method
are subject to a length limitation accordingly because they just translate into url parameters of the aforementioned remote includes.
As a best practice refrain from passing complex objects (e.g. full blown product models) but keep it rather slim (e.g. only product IDs).
Renders a region by triggering rendering of all visible components within this region. For each of these components the render function of the respective component type is invoked.
String : render( ComponentScriptContext context)
The return value of the render
function will be wrapped by an HTML element - this
finally represents the markup produced by this component type. The markup of the region
accordingly represents the concatenation of all the components markup within an
own wrapper element.
<p class="myRegionCssClass">
<span class="myComponentCssClass myComponentCssClass1" data-foo="bar">
...
</span>
<span class="myComponentCssClass myComponentCssClass2">
...
</span>
</p>
In order to go with the default settings for the wrapper elements see renderRegion(Region).
You must NOT call this method outside of the processing induced by renderPage(String, String).
Renders a region by triggering rendering of all visible components within this region. For each of these components the render function of the respective component type is invoked.
String : render( ComponentScriptContext params)
The return value of the render
function will be wrapped by an HTML element - this
finally represents the markup produced by this component type. The markup of the region
accordingly represents the concatenation of all the components markup within an
own wrapper element.
<div class="experience-region experience-pictures">
<div class="experience-component experience-assets-image">
...
</div>
<div class="experience-component experience-assets-image">
..
</div>
</div>
The system default for region render settings are:
The system default for component render settings are:
In order to provide your own settings for the wrapper elements see renderRegion(Region, RegionRenderSettings).
You must NOT call this method outside of the processing induced by renderPage(String, String).