Forums de discussion

path of js in custom_freemaker theme

abhishek kumar, modifié il y a 8 années.

path of js in custom_freemaker theme

Regular Member Publications: 138 Date d'inscription: 17/08/15 Publications récentes
hello folks,
somehow i stuck in middle of one of the task _

how to give the path of js in mine custom_freemaker_theme. ??

thanks
Abhishek
thumbnail
Bijan Vakili, modifié il y a 8 années.

RE: path of js in custom_freemaker theme (Réponse)

Expert Publications: 375 Date d'inscription: 10/03/09 Publications récentes
Note the theme init.ftl file; for Lifeary 6.2.x it is:
https://github.com/liferay/liferay-portal/blob/6.2.x/portal-web/docroot/html/themes/_unstyled/templates/init.ftl


In particular there's this assignment:

<#assign javascript_folder = theme_display.getPathThemeJavaScript() />


So you can use variable here:

javascript_folder

To create the path to the JS files; for example Liferay does this as well:
<#assign js_main_file = htmlUtil.escape(portalUtil.getStaticResourceURL(request, "${javascript_folder}/main.js")) />
abhishek kumar, modifié il y a 8 années.

RE: path of js in custom_freemaker theme

Regular Member Publications: 138 Date d'inscription: 17/08/15 Publications récentes
thanku sir it is working !emoticon