0

Include external javascripts and css in themes

asked 2015-04-20 15:52:58 +0800

cvalentina gravatar image cvalentina
3 1

Hi, I'm creating my own theme to use in my projects, my problem is that I would like to add some scripts to the theme so they will be included globally in the projects where I use the theme, and even execute some initialization code if it's possible, as for the styles there are some extra .less files that I would like to include, how do I do this? I'm using Eclipse Luna with maven and ZK EE 7.0.3

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-23 09:04:47 +0800

JustinFrost gravatar image JustinFrost
139 1 6

Regarding adding less files, you can import them in the norm.less of your theme project.

This is located at src/main/resources/web/<themename>/less/norm.less

Then just put the less file in the same folder and import by adding:

@import "~./<themename>/zul/less/_<lessfile>.less";

Regarding scripts do you mean javascript ? I have never put them in a theme, but try adding them to your src/main/resources/metainfo/zk/lang-addon.xml file like this:

<javascript src="~./<themename>/js/<filename>.js"/>

place the scripts in the location that suits where ~./ is the src/main/resources/web folder of your project.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-04-20 15:52:58 +0800

Seen: 21 times

Last updated: Apr 23 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More