Is SDI possible on head of HTML

Avatar

Avatar
Level 1
subhrom4264858
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
subhrom4264858
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
subhrom4264858
Level 1

16-06-2020

Is is possible to dynamically include a component (using SDI) such that it gets rendered on head section of HTML? Does that cause any error, details on any such use case which anyone tried before will be of great help.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Level 6
antoniom5495929
Level 6

Likes

91 likes

Total Posts

212 posts

Correct reply

39 solutions
Top badges earned
Establish
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
Level 6
antoniom5495929
Level 6

Likes

91 likes

Total Posts

212 posts

Correct reply

39 solutions
Top badges earned
Establish
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
antoniom5495929
Level 6

17-06-2020

Hi,

no, there's no issue by using SDI even if you apply it into an element which is located into the head.

Since SDI is just a way to skip the cache and make the build of the HTML at Apache level, if you apply an SDI  the browser should receive the HTML as you will create it by you AEM directly. It's for this reason that you will not find issues into the usage of it.

Anyway, if you want to use it (as probably I think) in order to avoid the cache of a "menu" component, I can confirm you that I already applied it in this way without any kind of issues.

 

Thanks,
Antonio

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 4
raghavc
Level 4

Likes

63 likes

Total Posts

61 posts

Correct reply

19 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 50
View profile

Avatar
Validate 1
Level 4
raghavc
Level 4

Likes

63 likes

Total Posts

61 posts

Correct reply

19 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 50
View profile
raghavc
Level 4

16-06-2020

Yes, it is possible to include a component using SDI inside the head section of the HTML.

Avatar

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
vanegi
Employee

16-06-2020

Yes, you can include using SDI [0]. Replace Resource types of header components with tags via the OSGi Configuration Factory at http://<host>:<port>/system/console/configMgr/org.apache.sling.dynamicinclude.Configuration. Check [1] for more details.

 

[0]: https://github.com/Cognifide/Sling-Dynamic-Include

[1]: https://docs.adobe.com/content/help/en/experience-manager-learn/foundation/development/set-up-sling-...