I have just come across this URL which briefs about the sightly syntax. But I am still not clear with some of the attributes that could be used along with data-sly-resource. Could you please explain the use cases for these options.
Reference URL: http://stackoverflow.com/questions/27583326/expression-option-sightly
Solved! Go to Solution.
the resourceType-option comes handy if you want to point to a different 'component' to render your node, other than the one specified via sling:resourceType on the node level.
<div data-sly-resource="${ 'foo' }"></div> renders the 'foo' node via the component specified at sling:resourceType
<div data-sly-resource="${ 'foo' @ resourceType='a/b/c/d' }"></div> renders the 'foo' node via the component a/b/c/d
Here the link to the doc: http://docs.adobe.com/docs/en/aem/6-1/develop/sightly/block-statements.html#resource
Hi Feike,
Thanks for the quick response.
I have gone through this page already. However I am still not very clear with some of the options which are highlighted again below. I have added some questions in the parenthesis below to make the question bit more clear if it wasn't before.
For e.g. I know that resourceType option could be used to include a component in the page like a <cq:include path="foo" resourceType="sample/components/foo/bar" /> which have the sightly syntax like below which creates a node 'foo' to store any dialog properties for the component 'sample/components/foo/bar'.
<div data-sly-resource="${'foo' @ resourceType='sample/components/foo/bar'}"></div>
Sorry if this is a basic question as I have not used it before.
Views
Replies
Total Likes
coolpaul wrote...
Hi Feike,
Thanks for the quick response.
I have gone through this page already. However I am still not very clear with some of the options which are highlighted again below. I have added some questions in the parenthesis below to make the question bit more clear if it wasn't before.
selectors: To replace the selectors.(any example to understand how this works?)
addSelectors: To add selectors.(any example to understand how this works?)
removeSelectors: To remove selectors. (any example to understand how this works?)
resourceType: To define or change the resource type ( how could be change the resourceType? )
For e.g. I know that resourceType option could be used to include a component in the page like a <cq:include path="foo" resourceType="sample/components/foo/bar" /> which have the sightly syntax like below which creates a node 'foo' to store any dialog properties for the component 'sample/components/foo/bar'.
<div data-sly-resource="${'foo' @ resourceType='sample/components/foo/bar'}"></div>
Sorry if this is a basic question as I have not used it before.
nice
Views
Replies
Total Likes
the resourceType-option comes handy if you want to point to a different 'component' to render your node, other than the one specified via sling:resourceType on the node level.
<div data-sly-resource="${ 'foo' }"></div> renders the 'foo' node via the component specified at sling:resourceType
<div data-sly-resource="${ 'foo' @ resourceType='a/b/c/d' }"></div> renders the 'foo' node via the component a/b/c/d
Hi Feike,
Thanks very much for clarifying this. This gives me a better idea about how the tag works with/without resourceType attribute. :)
I have found a Stackoverflow question which would give some contextual knowledge regarding the same and might be useful for some - http://stackoverflow.com/questions/23530232/how-to-properly-check-selectors-and-extensions-via-reque...
Views
Replies
Total Likes
Views
Likes
Replies