+ Start a Discussion

Site.com - Serving up HTML dynamically via a data repeater

I have created a website in which many pages are served up dynamically using data repeaters. The site works well, but I don't know a good way of storing elements such as an embedded YouTube video in a custom object. Similarly, it would be nice to be able to set some headers with HTML tags <h1> or bullets and have it rendered correctly in Site.com. Is there any practical way of doing this?


Hi SLaunch, 


We utilize a custom field within the custom object to capture the YouTube Video ID and then pass it back through a Custom Code block within the repeater. The code would look something like this (this example is working in conjunction with Fancybox):


<img class="video" alt={!VideoCaption__c} src='http://img.youtube.com/vi/{!YouTubeVideoID__c}/2.jpg'>
<a class="video-modal" href='http://www.youtube.com/v/{!YouTubeVideoID__c}?version=3&enablejsapi=1&autoplay=1'>Link</a>