Skip to content

Instantly share code, notes, and snippets.

View JonasEriksson's full-sized avatar

Jonas JonasEriksson

View GitHub Profile
@JonasEriksson
JonasEriksson / templatevars.cfm
Last active March 11, 2017 10:49 — forked from Dan4IT/templatevars.cfm
Mura Template Variables
<!--- Note JE: This reveals a bit much if used on a live server, so I added a simple IP check --->
<cfif cgi.REMOTE_ADDR EQ "myIPaddress">
#$.siteConfig('themeAssetPath')#
#$.siteConfig('assetPath')#
<cfdump var="#$.siteConfig().getAllValues()#">
#$.siteConfig('domain')#
@JonasEriksson
JonasEriksson / Code Snippets
Created January 17, 2016 01:13 — forked from ronnieduke/Code Snippets
Mura Code Snippets
=============================
Content Image
=============================
<img src="#$.content().getImageURL(size='large')#" />
=============================
Extended Attribute Image
=============================
<!--- First, create an extended attribute with the type of 'File' --->
<img src="#$.createHREFForImage(filename=$.content('myExtAttribute'))#" />
@JonasEriksson
JonasEriksson / extendedAttributes.cfm
Created January 17, 2016 01:13 — forked from Dan4IT/extendedAttributes.cfm
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' --->
@JonasEriksson
JonasEriksson / Foundation6 - headers
Created January 20, 2016 22:25
Foundation6 headers - Avoid skipping heading levels when structuring your document, as it confuses screen readers. For example, after using an <h2> in your code, the next heading used should be either <h2> or <h3>. If you need a heading to look bigger or smaller to match a specific style, use CSS to override the default size.
<h1>h1. This is a very large header.</h1>
<h2>h2. This is a large header.</h2>
<h3>h3. This is a medium header.</h3>
<h4>h4. This is a moderate header.</h4>
<h5>h5. This is a small header.</h5>
<h6>h6. This is a tiny header.</h6>
<!--
<!--- JS - this goes into the html footer --->
<script>
$(document).ready(function() {
function recalculate() {
var sum = 0;
$("input[type=checkbox]:checked").each(function() {
sum += parseInt($(this).attr("optionpricelocalcurrency"));
});
@JonasEriksson
JonasEriksson / config.xml.cfm
Created April 16, 2016 09:49 — forked from stevewithington/config.xml.cfm
Mura CMS : Example of how to create a Frequently Asked Questions (FAQ) area/section with Mura CMS and Bootstrap3 markup.
<!--
1) Drop this in your theme /{SiteID}/includes/themes/{Theme}/config.xml.cfm
-->
<theme>
<extensions>
<extension type="Folder" subType="FAQ" availableSubTypes="Page/Question" iconClass="icon-question-sign">
</extension>
<extension type="Page" subType="Question" iconClass="icon-question" hasSummary="0" hasBody="0" hasAssocFile="0">
</extension>
@JonasEriksson
JonasEriksson / MuraCMS-ContentBeans-example1.cfm
Created April 18, 2016 14:47
Mura CMS: Loading and displaying Mura Content Beans in a template
<!---
When building a single-page website with many content sections,
it can be easier to manage for end-users if the content parts
are managed as normal "pages" in Mura CMS, even if they are not
part of the normal/public site structure and/or navigation.
These normal content items (usually pages), then have Title,
Summary, Body, Associated Image etc. loaded by their respective
ContentID, page-name or titles.
The same applies to listing users with available contact information.
Below are a few examples on how this can be done for content.
@JonasEriksson
JonasEriksson / innomegacomponents_gallery_hc_images.cfm
Last active May 18, 2016 11:41
Displays three images in line filling the screen width. Useful to showcase products or services or as a very simple gallery.
<cfoutput>
<!-- start about me section -->
<div class="container-fluid">
<section class="section-main" id="aboutme">
<div class="row">
<!-- start left column with large round image based on square image input -->
<div class="col-sm-5">
<img src="#$.siteConfig('themeAssetPath')#/images/about-me/my_pic.jpg" class="img-responsive img-circle">
</div> <!--- /. col-sm-5 --->
<!-- /. end left column -->
<!--- Note: This is meant to be a super-simple "Warning or Update or Hint on the startpage. For example a sportsclub might announce changed training times, or a competition.
This requires an Extended Attribute for the Site/Default named WarningColour and noticeBGcolour, as well as a textfield named ImportantNotice. If it is not set, we fall back on the Material Colour definition of"orange darken-4" --->
<cfoutput>
<cfif len(#$.siteConfig('WarningColour')#)>
<cfset noticeBGcolour = #$.siteConfig('WarningColour')#><cfelse><cfset noticeBGcolour = "orange darken-4">
</cfif>
<cfif len($.siteConfig('ImportantNotice'))>
<div class="container-fluid">
<div class="row" style="background-color: #noticeBGcolour#">