[Hippo-cms7-user] Hippo rendering question

Jasha Joachimsthal j.joachimsthal at onehippo.com
Tue Jun 28 19:26:15 CEST 2011


On 28 June 2011 19:17, Stroomer, Jeff <Jeff.Stroomer at disney.com> wrote:

> Hippo Folks,****
>
> ** **
>
> I have a question concerning page rendering in Hippo.  It’s easiest to
> describe with an example.****
>
> ** **
>
> Suppose some, but not all, of the pages for my website contain
> ActionScript.  When a page contains ActionScript, I need to augment the page
> HTML header with a JavaScript function that loads ActionScript.  This
> function is big, and I don’t want to include it unless it’s needed.   So I’d
> like to be able to look at all the components for a page before actually
> rendering the page, and figure out whether to include the library.****
>
> ** **
>
> Is there any way to do this in Hippo?  This seems a lot  like a standard
> two-pass compiler problem.****
>
> ** **
>
> Thanks in advance for the help,****
>
> ** **
>
> Jeff****
>
>
> **
>

Hi Jeff,

yes this is possible with the hst:headContribution(s) tags. The most outer
JSP (the one that contains the html and head tags) should have a
<hst:headContributions/> tag. The JSP that has the knowledge about the
actionscript can then contain
<hst:headContribution><script>...</script></hst:headContribution>.
By assigning categories to the headContribution you can even define where in
the most outer JSP your actionscript should be rendered.
See for example [1] and [2].

[1]
http://svn.onehippo.org/repos/hippo/hippo-cms7/site-toolkit/tags/hst-2.23.00/demosuite/site/src/main/webapp/WEB-INF/jsp/templates/webpage.jsp
[2]
http://svn.onehippo.org/repos/hippo/hippo-cms7/site-toolkit/tags/hst-2.23.00/demosuite/site/src/main/webapp/WEB-INF/jsp/components/main/detailpage.jsp

Jasha Joachimsthal

Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll free)

www.onehippo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onehippo.org/pipermail/hippo-cms7-user/attachments/20110628/093ea5a2/attachment.htm>


More information about the Hippo-cms7-user mailing list