Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Including an html file from DAM within an html

deepak_chandra1
Level 1
Level 1

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!

1 Accepted Solution
Sham_HC
Correct answer by
Level 10
Level 10
6 Replies
GK-AEM
Level 9
Level 9

Can you please elaborate on the requirement?

Thanks,

Kishore

smacdonald2008
Level 10
Level 10

What are you trying to do - nest HTML? 

deepak_chandra1
Level 1
Level 1

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
Level 10

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
Community Advisor
Community Advisor

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
Correct answer by
Level 10
Level 10