I am using the reference component in AEM6.4. I have added the reference component in my header.html file. Whenever first time I am going to open the header.html page it will open the page with this component and I need to author the reference path in it, can I add default path in this component, so whenever author will open the page first time, then component will populate with default values in the path section. I have tried with "value" and defaultValue" property on node level but nothing is working. Please suggest.
You can write a servlet which query site to looks for pages which doesn't have prelogin and add prelogin node with default property using java API
SQL2 Query could be like below:
SELECT * FROM [cq:Page] AS s where isdescendantnode([/content/mfHTL63]) and s.[jcr:content/sling:resourceType] like '%mfHTL63/components/structure/page%' and s.[jcr:content/prelogin/sling:resourceType] not like '%mfHTL63/components/content/reference%'
I am using the reference component directly in my header.html, so that whenever author will create a page by using my pre-login-text template( this is static template not editable), it will auto populate with the default value, so author will not going to add any reference path in the edit mode of the page.
header.html:( my static template pointing to header.html file)
but whenever I am creating new page , it always showing empty path field. I have tried with "value" property also.
because I am using static template here then I have tried to add value on template level and its working fine, now can I do like this(adding value on template level) , is it correct in AEM6.4. Please suggest.