<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal00, li.msonormal00, div.msonormal00
        {mso-style-name:msonormal0;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {mso-style-name:msochpdefault;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.style-mailovzprvy18
        {mso-style-name:style-mailovzprvy18;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.style-mailovzprvy19
        {mso-style-name:style-mailovzprvy19;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.StylE-mailovZprvy24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1264462229;
        mso-list-type:hybrid;
        mso-list-template-ids:2036005204 1805827436 67436547 67436549 67436545 67436547 67436549 67436545 67436547 67436549;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:1663661742;
        mso-list-type:hybrid;
        mso-list-template-ids:-379696984 516062850 67436547 67436549 67436545 67436547 67436549 67436545 67436547 67436549;}
@list l1:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=CS link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Hello Jan,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>you just need to keep right order to load JS: jQuery > Component > Initialization<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I think the problem is you are trying to init component before is it loaded on the page, right? You have this options:<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><ul style='margin-top:0cm' type=disc><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo2'><span style='mso-fareast-language:EN-US'>Init components at the end of the page (only set variables in the formatters) – it can be added to the main apollo JS script (you need to build modified apollo JS)<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo2'><span style='mso-fareast-language:EN-US'>Load both - component and init script - in the formatters configuration, it will be loaded after the jQuery so it should work<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo2'><span style='mso-fareast-language:EN-US'>You can move headincludes from the end of the page to the page header in the apollo JSP template, but i don</span><span lang=EN-US style='mso-fareast-language:EN-US'>’t think it is good approach (in some cases it will do the job without “extra work”)</span><span style='mso-fareast-language:EN-US'><o:p></o:p></span></li></ul><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;color:black;background:white'>--<br>S pozdravem / </span><span lang=EN-US style='font-size:12.0pt;color:black;background:white'>Kind regards</span><span lang=EN-GB style='font-size:12.0pt;color:black;background:white'><br>Filip Kratochvil</span><span lang=EN-GB><o:p></o:p></span></p></div><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b>Od:</b> opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org] <b>za uživatele </b>Knezik Jan<br><b>Odesláno:</b> 01 January 2018 12:47<br><b>Komu:</b> 'The OpenCms mailing list' <opencms-dev@opencms.org><br><b>Předmět:</b> Re: [opencms-dev] Condition for headincludes tag<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p><span style='font-size:12.0pt;color:black'>Hello Filip,<o:p></o:p></span></p><p><span style='font-size:12.0pt;color:black'>you are right. Unfortunately, there are some libraries/components (ie lightgallery.js) which won't work properly unless placed in the page header.<o:p></o:p></span></p><p><span style='font-size:12.0pt;color:black'>​<o:p></o:p></span></p><p><span style='font-size:12.0pt;color:black'>Jan Knezik​<o:p></o:p></span></p><p><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p><div><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;color:#212121'><hr size=2 width="98%" align=center></span></div><div id=divRplyFwdMsg><p class=MsoNormal><b><span style='color:black'>Od:</span></b><span style='color:black'> <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a> <<a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>> za uživatele Filip Kratochvil <<a href="mailto:filip.kratochvil@nelasoft.cz">filip.kratochvil@nelasoft.cz</a>><br><b>Odesláno:</b> 22. prosince 2017 17:50<br><b>Komu:</b> 'The OpenCms mailing list'<br><b>Předmět:</b> Re: [opencms-dev] Condition for headincludes tag</span><span style='font-size:12.0pt;color:#212121'> <o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;color:#212121'> <o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='color:#212121'>Hello Jan,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'>no, you can‘t use any condition.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'>But if you will include css/js using formatter’s configuration described here:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'><a href="http://documentation.opencms.org/opencms-documentation/content-in-opencms/formatters-and-their-configuration/index.html">http://documentation.opencms.org/opencms-documentation/content-in-opencms/formatters-and-their-configuration/index.html</a><o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'>you can make more than one formatter for one resource type. One formatter will include css/js, second will not include css/js.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'> <o:p></o:p></span></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-GB style='font-size:12.0pt;color:black;background:white'>--<br>S pozdravem / </span><span lang=EN-US style='font-size:12.0pt;color:black;background:white'>Kind regards</span><span lang=EN-GB style='font-size:12.0pt;color:black;background:white'><br>Filip Kratochvil</span><span style='color:#212121'><o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#212121'> <o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='color:#212121'>Od:</span></b><span style='color:#212121'> <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a> [<a href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] <b>za uživatele </b>Knezik Jan<br><b>Odesláno:</b> 22 December 2017 17:20<br><b>Komu:</b> <a href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a><br><b>Předmět:</b> [opencms-dev] Condition for headincludes tag<o:p></o:p></span></p></div></div><p class=MsoNormal><span style='color:#212121'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#212121'>Hello,</span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#212121'>I need a condition for including js and css files in xsd file (I am using headincludes tag). Is something like this available in OpenCMS?</span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#212121'> </span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#212121'>Thank you very much,</span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#212121'>Jan Knezik</span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#212121'> </span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#212121'> </span><span style='color:#212121'><o:p></o:p></span></p></div></div></div></div></body></html>