Skip to content

Instantly share code, notes, and snippets.

View designermonkey's full-sized avatar

John Porter designermonkey

View GitHub Profile
@designermonkey
designermonkey / data_1.xml
Created February 12, 2013 23:06
Using Names and Matches together in XSL templates, we can choose and apply templates dynamically, based on content provided within the XML being transformed. I've searched for ages on how to do this properly, and a number of sources led me to this solution.
<data>
<datasource>
<section handle="test-section">Test Section</section>
<entry>
<page-path handle="about">/about</page-path>
<page-title handle="about">About</page-title>
<title handle="about-this-company">About This Company</title>
<template>
<item id="2" handle="content" section-handle="page-templates" section-name="Page Templates">Content</item>
</template>
<data>
<thumbs>
<item>120</item>
<item>240</item>
<item>360</item>
</thumbs>
</data>
<data>
<aspectratios>
<item name="onebyone">1</item>
<item name="onebytwo">0.5</item>
<item name="onebythree">0.33333</item>
<item name="twobyone">2</item>
<item name="twobythree">0.66667</item>
<item name="twobyfive">0.4</item>
<item name="threebyone">3</item>
<item name="threebytwo">1.5</item>
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
<data>
<preferences>
<sitename>Client - Portfolio</sitename>
<languages>
<entry id="1" handle="english" lang="en">English</entry>
<entry id="2" handle="francais" lang="fr">Francais</entry>
</languages>
<stylesheets><entry id="1"><url link="http://link-to-main.stylesheet.css"/></entry></stylesheets>
<scripts><entry id="1"><url link="http://link-to-main.stylesheet.css"/></entry></scripts>
<navlinks>
@designermonkey
designermonkey / config.xml
Created July 1, 2012 20:39
Proposed Symphony CMS config XML
<?xml version="1.0" encoding="UTF-8"?>
<config:core xmlns:config="http://symphony-cms.com/schemas/config/1.0">
<!--
Environment
Specify the environment of your setup
Environments can be any value, which will be passed through to
<?xml version="1.0" encoding="UTF-8"?>
<data>
<Object>
<NVMVestigingNR>12093</NVMVestigingNR>
<ObjectCompany>42209</ObjectCompany>
<ObjectAfdeling>903782</ObjectAfdeling>
<ObjectTiaraID>1207204</ObjectTiaraID>
<ObjectSystemID>1186339</ObjectSystemID>
<ObjectCode>CM10208</ObjectCode>
<ObjectDetails>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../utilities/master.xsl"/>
<xsl:template match="data">
<h2>Άρθρα καταστατικού</h2>
<ul>
<xsl:apply-templates select="katastatiko/entry">
<xsl:sort select="katastatiko_article_number" data-type="number" order="ascending"/>
@designermonkey
designermonkey / zen_settings.py
Created May 29, 2012 15:18
Updated Zen Settings for XSL
"""
Zen Coding settings
@author Sergey Chikuyonok (serge.che@gmail.com)
@link http://chikuyonok.ru
"""
zen_settings = {
# Variables that can be placed inside snippets or abbreviations as ${variable}
# ${child} variable is reserved, don't use it
'variables': {
<data>
<pants>
<entry>
<content>Test 1</content>
</entry>
<entry>
<content>Test 2</content>
</entry>
<entry>
<content>Test 3</content>