Including an html file from DAM within an html | Community
Skip to main content
June 24, 2016
Solved

Including an html file from DAM within an html

  • June 24, 2016
  • 6 replies
  • 3241 views

Hi. Does Sightly provide any functionality for an html file placed in the DAM to be included in another html. I've tried data-sly-include but that didn't seem to work for html files placed in the DAM. 

 

Thanks in advance!

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

6 replies

GK-007
Level 9
June 24, 2016

Can you please elaborate on the requirement?

Thanks,

Kishore

smacdonald2008
Level 10
June 24, 2016

What are you trying to do - nest HTML? 

June 24, 2016

I have an html file in my DAM with the following content in it : 

<p> Line 1 </p> <p> Line 2 </p>

 

I'd like to place this content within an html of one of my components. As I mentioned earlier, I've tried using data-sly-include in the component specifying the path of the file in the DAM but that didn't work out. 

PS. I was able to implement this using <div w3-include-html="path to DAM asset"> but was wondering if Sightly provides any way to do the same. 

smacdonald2008
Level 10
June 24, 2016

To display HTML located in the dam into a Sighly component - try using syntax @  http://www.w3schools.com/howto/howto_html_include.asp. The reason why include does not work is because the HTML in the DAM does not have a resource type. Its an asset like a JPG - and can be referenced using an URL. 

Lokesh_Shivalingaiah
Level 10
June 24, 2016

What is the file type stored in the DAM ? 

I would recommend  to store HTML as a property of a node. Then read that property to be included. 

Sham_HC
Sham_HCAccepted solution
Level 10
June 28, 2016