Skip to main content
Jun 24, 2016 7:23 AM UTC
Solved

Including an html file from DAM within an html

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
Jun 24, 2016 12:55 PM UTC

Can you please elaborate on the requirement?

Thanks,

Kishore

Translate
smacdonald2008
Level 10
Jun 24, 2016 12:56 PM UTC

What are you trying to do - nest HTML? 

Translate
Jun 24, 2016 1:07 PM UTC

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. 

Translate
smacdonald2008
Level 10
Jun 24, 2016 1:20 PM UTC

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. 

Translate
Lokesh_Shivalingaiah
Level 10
Jun 24, 2016 5:29 PM UTC

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. 

Translate
Sham_HC
Sham_HCAccepted solution
Level 10
Jun 28, 2016 3:17 AM UTC