Hello,
I'd like to validate the following approach for a content that is spread in the template.
We need to produce of a page composed of:
- header (template)
- menu (template)
- main image (content)
- breadcrumb (template)
- social network icons (template)
- product list (content)
- footer (template)
So fragments of a given document (here: main image and product list) and of the template (header, menu, social icons, footer...) are interwoven.
This is how I implemented it:
Template:
hst:pages
standardprolog (template=layout.webpage.prolog)
header
prolog (template=standard.main)
breadcrumb
social-share
main (template=standard.main)
footer
Product page:
hst:pages
product (referencecomponent=hst:pages/standardprolog)
prolog
content
main
content
main
Prolog, main and standardprolog point to their templates which in turn point to their respective JSPs.
webpage-prolog.jsp
<body>
<hst:include ref="header"/>
<hst:include ref="prolog"/>
<hst:include ref="breadcrumb"/>
<hst:include ref="social-share"/>
<hst:include ref="main"/>
<hst:include ref="footer"/>
</body>
Does this approach make sense? The only inelegant thing I see is that the component (Detail extends BaseHstComponent) is called twice to retrieve the bean: once for the prolog and once for the main part. Not even sure it implies a performance penalty. Your opinion is welcome -- and if this is the way to go, this page can serve for someone else.
Thanks