Welcome back! Let’s continue our discussion about caching techniques in Oracle WebCenter Sites (OWCS). In this article, let’s go a bit advanced into coding.
Setting style attribute in render:calltemplate
render:calltemplate is the OWCS tag predominantly used to call a Template. “Style” is a flag that indicates that the called Template should be called as an element or as a pagelet, and if it is to be called as a pagelet, should it be embedded in the parent for Satellite Server or should it be an independent pagelet. The default value is pagelet. It has 3 possible values, namely pagelet, embedded, and element.
Setting this attribute value to element will result in the template being called as an element. This is useful if a nested pagelet is not necessary or desirable (in other words, it would be overkill) for the target Template.
When the style is element, the scope of the called element is local: only variables specified as arguments and attributes will be accessible to the called element, and variable values in the caller will not be affected.
When the style is set to embedded, the nested template is invoked as a pagelet without using Satellite Server. This causes the pagelet to be independently rendered (and possibly cached) by Sites but the result of the pagelet is embedded in the caller, just as if it had been called as an element. Satellite Server does not see embedded pagelets as separate from their caller; they are simply part of the output of the caller.
Note that if this is set to element or embedded, the invoked Template will be embedded in the caller and this can have performance, dependency, and caching implications, which can be good or bad depending on your code.
Setting style attribute in render:calltemplate
This attribute contains a context override parameter. It is only meaningful if the called template contains code which defines a presentation slot, using the insite:calltemplate tag. This attribute contains a context override parameter.
For example, if a “Hero Banner” is to be rendered on both Home and Contact Us pages, then OWCS caches two different copies, which are essentially duplicates and not desired. This is because OWCS caches a pagelet based on its parent also, in the context info. So, declaring an empty context attribute like context=”” will suspend that info.
Thanks for joining us for this 2-part series! Stay tuned for more tips and information about how you can best utilize WebCenter Sites for your business. And if you’d like help upgrading your Oracle WebCenter Sites environment from 11g to 12c before the December Premier Support deadline, contact us at Inspired ECM to let our experienced consultants get your environment running efficiently and successfully today.