htl

Adding “defer” attribute to clientLib script tags in AEM 6.1

五迷三道 提交于 2019-12-31 05:50:48
问题 How would I add the defer attribute to our script tags? We get them via the clientLib tag call in our head.html but there's not much out there for AEM and how to easily add the defer tag to our scripts. <clientlib data-sly-call="${clientLib.all @ categories=['company-libraries']}" data-sly-unwrap/> Any help is appreciated! Thanks 回答1: You could use Jens answer: https://github.com/nateyolles/aem-clientlib-async but that one does not play nice with ACS commons versioned clientlib.which is why I

Sightly Implicit Objects

故事扮演 提交于 2019-12-25 02:45:12
问题 I am trying to implement my own version of WCM's navigation component, whose logic can be found here, subbing my own logic instead: import java.util.*; import com.day.cq.wcm.api.Page; import com.day.cq.wcm.api.PageFilter; import com.adobe.cq.sightly.WCMUsePojo; public class Navigation extends WCMUsePojo{ private Iterator<Page> items; @Override public void activate() throws Exception { Page navRootPage = getCurrentPage().getAbsoluteParent(2); items = navRootPage.listChildren(new PageFilter());

AEM sightly how to reuse variables

…衆ロ難τιáo~ 提交于 2019-12-22 18:04:10
问题 can I use variables in another file that I'm including? in my HTL (file1.html) I have: <sly data-sly-test.myVar="${properties.myVarFromDialog}"></sly> <sly data-sly-include="/file2.html"></sly> Can I use myVar in file2.html ? I'm not getting any value. Is there a way of getting that value from file1.html to use in file2.html 回答1: You should use data-sly-template for this. You can define templates in a separate file and can pass in parameters. For an explanation on templates check the

How to create a radio button in aem 6 touch dialog

梦想的初衷 提交于 2019-12-21 19:58:17
问题 I am having a touch UI component for which I am creating a dialog in AEM 6. I have a requirement to create 2 radio buttons in the touch dialog and if either one of them are selected, the corresponding value of the selected radio button should be displayed. however, I am not understanding how to create the radio button options. I have implemented the same in classic dialog where the xtype=selection and type=radiogroup is used, but I do not understand how to create it in touch dialog 回答1: You

AEM Tag picker widget on a page

心已入冬 提交于 2019-12-13 03:47:27
问题 I am working on a functionality where the user selects a Tag from a namespace and clicks a button. Currently, we have a text box where user needs to enter the tag ID. But its not convenient for them to know the tagID. Is there any way to create a Tags Widget (or a Path Browser ) on a component HTML, similar to how it works in the dialog ? I know Coral UI dependencies may be an issue, but just curious if we can achieve that. I've never done something like this. 回答1: I hadwritten a similar

AEM 6.3 Using OSGi R6 Annotations and Sling Models

≯℡__Kan透↙ 提交于 2019-12-11 16:59:08
问题 I am trying to create an OSGi Service using OSGi R6 annotations and then injecting it in the Sling Model class like this: package com.aem.sites.models; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.aem.sites.services.WeatherService; @Model(adaptables=Resource.class) public class Banner { final static Logger

AEM sightly how to reuse variables

╄→гoц情女王★ 提交于 2019-12-06 09:06:09
can I use variables in another file that I'm including? in my HTL (file1.html) I have: <sly data-sly-test.myVar="${properties.myVarFromDialog}"></sly> <sly data-sly-include="/file2.html"></sly> Can I use myVar in file2.html ? I'm not getting any value. Is there a way of getting that value from file1.html to use in file2.html You should use data-sly-template for this. You can define templates in a separate file and can pass in parameters. For an explanation on templates check the following documentation link http://docs.adobe.com/docs/en/aem/6-0/develop/sightly.html#template Firstly, for the

How to create a radio button in aem 6 touch dialog

夙愿已清 提交于 2019-12-04 14:07:43
I am having a touch UI component for which I am creating a dialog in AEM 6. I have a requirement to create 2 radio buttons in the touch dialog and if either one of them are selected, the corresponding value of the selected radio button should be displayed. however, I am not understanding how to create the radio button options. I have implemented the same in classic dialog where the xtype=selection and type=radiogroup is used, but I do not understand how to create it in touch dialog You can use Form Input - Radio . To create a radio button group give all radio buttons the same name . The

Rendering telephone links in HTL based on input from a Rich Text widget

故事扮演 提交于 2019-12-01 05:26:00
I have a component using the Rich Text Edit widget ( xtype="richtext" ) in my project that's used across the entire site as the default text component. The users would like to be able to insert phone links using the tel URI scheme into the text entered using this component. The dialog allows them to do so but when the contents of the Rich Text Edit are rendered in Sightly/HTL later on, the html context is used: {$text @ context='html'} Once this is done, the value of my attribute is ignored. The HTML stored in the repository is: <a href="tel:04242424242">Call us!</a> And what's actually

Rendering telephone links in HTL based on input from a Rich Text widget

旧巷老猫 提交于 2019-12-01 03:07:26
问题 I have a component using the Rich Text Edit widget ( xtype="richtext" ) in my project that's used across the entire site as the default text component. The users would like to be able to insert phone links using the tel URI scheme into the text entered using this component. The dialog allows them to do so but when the contents of the Rich Text Edit are rendered in Sightly/HTL later on, the html context is used: {$text @ context='html'} Once this is done, the value of my attribute is ignored.