Skip to content

Instantly share code, notes, and snippets.

View markhowellsmead's full-sized avatar

Mark Howells-Mead markhowellsmead

View GitHub Profile
<f:if condition="{image}">
<v:var.set name="falImage" value="{v:content.resources.fal(field: 'image') -> v:iterator.extract(key: 'id') -> v:iterator.first()}"/>
<div class="module image">
<v:resource.image
identifier="{falImage}"
width="676c"
height="237"
alt="{falImage.alternative}"
/>
</div>
@markhowellsmead
markhowellsmead / FCE for teaser with image, title, text and link button
Last active August 29, 2015 13:57
FLUID: FCE for teaser with image, title, text and link button
@markhowellsmead
markhowellsmead / config.multidomain.txt
Last active August 29, 2015 13:58
TypoScript for cross-site menu links in multidomain / multisite setup
# Allow cross-site menu links in multidomain / multisite setup
# With properly rendered RealURL links (incl. full external domain path).
# Add the following code to an existing typoscript base in TYPO3.
# This code alone is not sufficient to make a working website :)
# m@mhm.li - 04/2014 - Free use, no credit required
# Requires standard config of RealURL.
# Add the following to TS Setup:
@markhowellsmead
markhowellsmead / powermail_escapestrings
Created April 11, 2014 13:12
TypoScript: Escape backslashes in inline Powermail translation strings
# Powermail includes required translations for Javascript inline (in the page footer HTML)
# Some translations e.g. French include single quotes, which break the format of the Javascript string.
# m@mhm.li - 04/2014 - Free use, no credit required
# Via http://forge.typo3.org/issues/54183
# Add the following to TS Setup:
page.1000 {
10 {
stdWrap.replacement {
@markhowellsmead
markhowellsmead / rte.txt
Created April 15, 2014 13:02
TYPO3: Add custom blockstyle to RTE
# Define specific block style for the RTE editor in TYPO3 v6.1.7+
# Probably works in older v6 versions, but not tested
# Add the following to TS config on the root page of your site
# and add applicable CSS rules to e.g. fileadmin/templates/unia2014/Resources/Public/css/RTE.css
# to make the formatting work in the BE.
# (You will need to add the CSS to your FE CSS too.)
# m@mhm.li - 04/2014 - Free use, no credit required
RTE.classes{
@markhowellsmead
markhowellsmead / google_analytics.txt
Last active August 29, 2015 14:00
TYPO3 - TypoScript - Google Analytics
# Set the following constants:
# config.google.analytics.code
# config.google.analytics.domain
# mark@permanenttourist.ch 5.5.2014 - Free use, no credit required
lib.googleanalytics = TEXT
lib.googleanalytics.value (
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{$config.google.analytics.code}', '{$config.google.analytics.domain}');
@markhowellsmead
markhowellsmead / hasStorage.js
Created May 14, 2014 11:41
Javascript check to see if localStorage (HTML5 in-browser machanism) is supported
var hasStorage = (typeof(Storage)!=="undefined" && typeof(localStorage)!=="undefined");
@markhowellsmead
markhowellsmead / svg-background-image.less
Created May 14, 2014 16:01
Use SVG background images with automatic PNG fallback (LESS mixin)
.svg-background-image(@svg,@fallback){
/*
From css-tricks.com/using-svg/
coincidentally, if multiple backgrounds are supported, then so are SVG images!
Usage:
.svg-background-image('my.svg','fallback.png');
*/
background-image: url('@{fallback}');
@markhowellsmead
markhowellsmead / .htaccess
Created May 15, 2014 07:46
htaccess protection, with open access from specific IP addresses or IP address ranges
AuthUserFile /path/to/.htpasswd
AuthName "Restricted Access"
AuthType Basic
require user [username]
satisfy any
deny from all
allow from 192.168.1.
allow from 10.1.1.45
allow from 172.16.5.106
@markhowellsmead
markhowellsmead / jsload.js
Created May 15, 2014 10:57
Load Javascript files to a page in sequence if Javascript is available
<script>
!function(e,t,r){function n(){for(;d[0]&&"loaded"==d[0][f];)c=d.shift(),c[o]=!i.parentNode.insertBefore(c,i)}for(var s,a,c,d=[],i=e.scripts[0],o="onreadystatechange",f="readyState";s=r.shift();)a=e.createElement(t),"async"in i?(a.async=!1,e.head.appendChild(a)):i[f]?(d.push(a),a[o]=n):e.write("<"+t+' src="'+s+'" defer></'+t+">"),a.src=s}(document,"script",[
"//code.jquery.com/jquery-latest.js",
"js/ui.js"
]);
</script>