[opencms-dev] Condition for headincludes tag

Filip Kratochvil filip.kratochvil at nelasoft.cz
Tue Jan 2 15:20:16 CET 2018


Hello Jan,

 

you just need to keep right order to load JS: jQuery > Component > Initialization

 

I think the problem is you are trying to init component before is it loaded on the page, right? You have this options:

 

*	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)
*	Load both - component and init script - in the formatters configuration, it will be loaded after the jQuery so it should work
*	You can move headincludes from the end of the page to the page header in the apollo JSP template, but i don’t think it is good approach (in some cases it will do the job without “extra work”)

 

--
S pozdravem / Kind regards
Filip Kratochvil

 

Od: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] za uživatele Knezik Jan
Odesláno: 01 January 2018 12:47
Komu: 'The OpenCms mailing list' <opencms-dev at opencms.org>
Předmět: Re: [opencms-dev] Condition for headincludes tag

 

Hello Filip,

you are right. Unfortunately, there are some libraries/components (ie lightgallery.js) which won't work properly unless placed in the page header.

​

Jan Knezik​

 

  _____  

Od: opencms-dev-bounces at opencms.org <mailto:opencms-dev-bounces at opencms.org>  <opencms-dev-bounces at opencms.org <mailto:opencms-dev-bounces at opencms.org> > za uživatele Filip Kratochvil <filip.kratochvil at nelasoft.cz <mailto:filip.kratochvil at nelasoft.cz> >
Odesláno: 22. prosince 2017 17:50
Komu: 'The OpenCms mailing list'
Předmět: Re: [opencms-dev] Condition for headincludes tag 

 

Hello Jan,

 

no, you can‘t use any condition.

 

But if you will include css/js using formatter’s configuration described here:

http://documentation.opencms.org/opencms-documentation/content-in-opencms/formatters-and-their-configuration/index.html

 

you can make more than one formatter for one resource type. One formatter will include css/js, second will not include css/js.

 

--
S pozdravem / Kind regards
Filip Kratochvil

 

Od: opencms-dev-bounces at opencms.org <mailto:opencms-dev-bounces at opencms.org>  [mailto:opencms-dev-bounces at opencms.org] za uživatele Knezik Jan
Odesláno: 22 December 2017 17:20
Komu: opencms-dev at opencms.org <mailto:opencms-dev at opencms.org> 
Předmět: [opencms-dev] Condition for headincludes tag

 

Hello,

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?

 

Thank you very much,

Jan Knezik

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20180102/e5c02a99/attachment.htm>


More information about the opencms-dev mailing list