Skip to content

Instantly share code, notes, and snippets.

View Dan4IT's full-sized avatar

Daniel Jansen Dan4IT

View GitHub Profile
@Dan4IT
Dan4IT / extendedAttributes.cfm
Last active January 28, 2016 05:13
Mura Extended Attributes
<!--- There are many ways you can display extended attributes. The most common way to display the value of an attribute is to use the content bean from the event upon rendering and ask for the attribute. This can be done by using the below code: --->
<cfoutput>#$.content( {attributeName} )#</cfoutput>
<cfoutput>#$.content('productPrice')#</cfoutput>
[mura]$.content('productPrice')[/mura]
<!--- Display Extended Attribute Image, including custom image size - within Iterator --->
<img alt="#sub1.getMenuTitle()#" class="img-responsive" src="#$.getURLForImage(sub1.getfilethumbnail(size = 'standardimage'))#">
<!--- Method on displaying Mura extended attribute images, including custom image sizes --->
<!--- Assuming you've created an extended attribute 'File' type called 'extAttributeImage' --->
@Dan4IT
Dan4IT / navbar.cfm
Created August 24, 2015 06:13
Mura - Centred Navbar
<style type="text/css">
.navbar-nav {
width: 100%;
text-align: center;
}
.navbar-nav li {
float: none;
display: inline-block;
}
@Dan4IT
Dan4IT / backstretch.htm
Created August 24, 2015 05:39
Backstretch
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.4/jquery.backstretch.min.js"></script>
<script type="text/javascript">
$.backstretch([
"#$.siteConfig('assetPath')#/assets/Image/Image_Name.jpg"
], {duration: 6000, fade: 1000});
</script>
@Dan4IT
Dan4IT / slider.cfm
Created August 16, 2015 05:56
Mura - Unify Slider
<cfoutput>
<!--=== Slider ===-->
<div class="slider-inner">
<div id="da-slider" class="da-slider">
<cfset it=$.getBean('feed').loadBy(name='Slideshow').getIterator()>
<cfloop condition="it.hasNext()">
@Dan4IT
Dan4IT / featured_pages_iterator.cfm
Created August 16, 2015 05:55
Mura - Featured Pages Iterator
@Dan4IT
Dan4IT / templatevars.cfm
Last active January 17, 2016 01:11
Mura Template Variables
#$.siteConfig('themeAssetPath')#
#$.siteConfig('assetPath')#
<cfdump var="#$.siteConfig().getAllValues()#">
#$.siteConfig('domain')#
<cfdump var="#$.content().getAllValues()#">
#$.content('metaKeywords')#
<cfif len($.siteConfig('contactname'))>#$.siteConfig('contactname')#</cfif>
@Dan4IT
Dan4IT / equal_height_cols.htm
Created May 5, 2015 10:54
Bootstrap 3 - Equal Height Cols
<div class="row table-row">
<div class="col-md-4">This column is super duper long and there for it'll appear taller than the rest on devices larger than 768px. More blah blah blah blah blah blah blah blah blah blah blah blah blah blah herp derp.</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
</div>
@Dan4IT
Dan4IT / agents_iterator.cfm
Last active August 29, 2015 14:20
Mura - AgentsIterator
<!--- Pull out a content iterator of the nodes child content.--->
<cfset it=$.getBean('content').loadBy(contentID='AgentsPageContentID',siteID=event.getValue('siteID')).getKidsIterator()>
<!--- The number of Items to be listed is determined by the content.getNextN() value. It's default is 10. --->
<!---<cfset it.setPage(1)>--->
<cfset it.setNextN(10)>
<!--- You can also set the start row instead of setting a page number. --->
<!---<cfset it.setStartRow(1)>--->
<!---<cfloop from="1" to="#it.pageCount()#" index="p">
@Dan4IT
Dan4IT / kids_iterator.cfm
Created May 1, 2015 08:00
Mura Kids Iterator
<h2 class="page-header">What's On</h2>
<!--- Pull out a content iterator of the nodes child content.--->
<cfset it=$.getBean('content').loadBy(contentID='contentIDHere',siteID=event.getValue('siteID')).getKidsIterator()>
<!--- The number of Items to be listed is determined by the content.getNextN() value. It's default is 10. --->
<!---<cfset it.setPage(1)>--->
<cfset it.setNextN(5)>
<!--- You can also set the start row instead of setting a page number. --->
<!---<cfset it.setStartRow(1)>--->
@Dan4IT
Dan4IT / comment_count.html
Last active August 29, 2015 14:20
How to Add Disqus to a Site
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'your-unique-disqus-url';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);