liferay-velocity

css not getting applied for velocity template in Liferay Theme

无人久伴 提交于 2021-01-29 02:05:29
问题 I am using LIferay Theme to create a theme for a website. IN the portal_normal.vm file, I have included all the html code and css I have defined in custom.css THe problem is that css from custom.css is not getting applied to portal_normal.vm page SHould I include some file in velocity file which tells that custom.css should be included? Also is it ok to include all css code in velocity? Regards EDIT: custom.css and portal_normal.vm are inside _diffs folder 回答1: put the custom.css under ~

css not getting applied for velocity template in Liferay Theme

无人久伴 提交于 2021-01-29 02:04:04
问题 I am using LIferay Theme to create a theme for a website. IN the portal_normal.vm file, I have included all the html code and css I have defined in custom.css THe problem is that css from custom.css is not getting applied to portal_normal.vm page SHould I include some file in velocity file which tells that custom.css should be included? Also is it ok to include all css code in velocity? Regards EDIT: custom.css and portal_normal.vm are inside _diffs folder 回答1: put the custom.css under ~

css not getting applied for velocity template in Liferay Theme

浪尽此生 提交于 2021-01-29 02:02:04
问题 I am using LIferay Theme to create a theme for a website. IN the portal_normal.vm file, I have included all the html code and css I have defined in custom.css THe problem is that css from custom.css is not getting applied to portal_normal.vm page SHould I include some file in velocity file which tells that custom.css should be included? Also is it ok to include all css code in velocity? Regards EDIT: custom.css and portal_normal.vm are inside _diffs folder 回答1: put the custom.css under ~

Liferay velocity template showing only first image for repeatable image field

纵饮孤独 提交于 2020-01-17 04:59:26
问题 I have created structures and template for adding the events. The input I have taken is: year with month, image for the event, description for the event. All the data is displaying properly except image. The image which I have given first is displaying for each event. Can any one help me? <root available-locales="en_US" default-locale="en_US"> <dynamic-element dataType="html" fieldNamespace="ddm" indexType="keyword" name="about_fe" readOnly="false" repeatable="false" required="false"

How to find web contents with specific structure field value?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 02:08:42
问题 I was wondering if anyone could give me some ideas/snippets on how to create Velocity template to loop through Web Content items for a specific structure , and render the contents based on the value of a specific structure field? 回答1: Here is a snippet from navigation.vm that will render group links: #set($groupLocalService = $serviceLocator.findService("com.liferay.portal.service.GroupLocalService")) #set($groupCount = $groupLocalService.getGroupsCount()) #set($groups = $groupLocalService

Liferay access DB table in theme: No bean named 'com.colors.themes.service.ColorLocalService' is defined

淺唱寂寞╮ 提交于 2019-12-23 06:00:12
问题 I have a theme project in liferay. I have created a new table called colors in my liferay MySQL database. The colors table is given below Actually I have a requirement that a particular css file should be loaded in theme based on the color table value whose status is true and my velocity template should be somewhat like as shown below #set ($myColorService = $serviceLocator.findService("com.colors.themes.service.ColorLocalService")) #set ($myColor = $myColorService.fetchActiveColor()) #if (

Create object in velocity template

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 03:58:10
问题 I am writing velocity templates for my liferay theme and I am wondering, whether it is possible to create a new object inside the velocity template. The reason is that in liferay there is no contextTool registered in the context and I really want to be able to inspect the variables that are present in the template at a given time. There is a cool macro for this, but unfortunately it uses the contexttool. I'd like to do something like: #set($contextTool = new ContextTool()) Another solution

Create object in velocity template

倖福魔咒の 提交于 2019-12-22 03:56:05
问题 I am writing velocity templates for my liferay theme and I am wondering, whether it is possible to create a new object inside the velocity template. The reason is that in liferay there is no contextTool registered in the context and I really want to be able to inspect the variables that are present in the template at a given time. There is a cool macro for this, but unfortunately it uses the contexttool. I'd like to do something like: #set($contextTool = new ContextTool()) Another solution

Using custom services or liferay services in liferay themes (velocity templates)?

纵然是瞬间 提交于 2019-12-19 04:05:10
问题 How to use custom services method in liferay themes in velocity files like init_custom.vm , portal_normal.vm etc. I see liferay provides a lot of variables of helper utility classes like $portalUtil for PortalUtil, $getterUtil for GetterUtil and so on, inside the init.vm file. So is it possible to get instance of my custom services like an instance of com.my.custom.service.MyCustomLocalServiceImpl or services of liferay from UserLocalServiceImpl ? Here is some psuedo code, to give an idea of

Sort list of objects in Velocity template - Liferay

寵の児 提交于 2019-12-13 16:06:46
问题 I've created a structure in Liferay as below <root> <dynamic-element name='header' type='text' index-type='' repeatable='true'> <dynamic-element name='headerlink' type='text' index-type='' repeatable='false'> </dynamic-element> <dynamic-element name='location' type='text' index-type='' repeatable='false'> </dynamic-element> <dynamic-element name='description' type='text_box' index-type='' repeatable='false'> </dynamic-element> <dynamic-element name='date' type='text' index-type='' repeatable=