Is SDI possible on head of HTML | Community
Skip to main content
June 16, 2020
Solved

Is SDI possible on head of HTML

  • June 16, 2020
  • 3 replies
  • 2076 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by antoniom5495929

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

3 replies

raghavc
Level 4
June 16, 2020

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

vanegi
Adobe Employee
Adobe Employee
June 16, 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-dynamic-include.html

antoniom5495929
antoniom5495929Accepted solution
Level 7
June 17, 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