Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active September 17, 2020 10:26
Show Gist options
  • Save stevewithington/0ef187072e6898cc3c17634a65ce7d51 to your computer and use it in GitHub Desktop.
Save stevewithington/0ef187072e6898cc3c17634a65ce7d51 to your computer and use it in GitHub Desktop.
Mura CMS v7: Sample YouTube Display Object
<displayobject name="YouTube Video" contenttypes="*"/>
<cfsilent>
<cfparam name="objectParams.youtubeurl" default="">
</cfsilent>
<cf_objectconfigurator>
<cfoutput>
<div class="mura-layout-row">
<div class="mura-control-group">
<label class="mura-control-label">YouTube URL</label>
<input type="text" name="youtubeurl" class="objectParam" value="#esapiEncode('html_attr',objectParams.youtubeurl)#"/>
</div>
</div>
</cfoutput>
</cf_objectconfigurator>
<cfsilent>
<cfparam name="objectParams.youtubeurl" default="">
</cfsilent>
<cfoutput>
<p>Hello from the YouTube display object.</p>
<div class="youtube-wrapper">
<iframe id="ytplayer" type="text/html" width="640" height="390"
src="https://www.youtube.com/embed/#ListLast(objectParams.youtubeurl, '=')#"
frameborder="0"></iframe>
</div>
<p><a href="#objectParams.youtubeurl#" target="_blank">Watch on YouTube</a></p>
<!--- <cfdump var="#objectParams#"> --->
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment