Skip to content

Instantly share code, notes, and snippets.

@ijy
ijy / search-and-replace-2.xsl
Created September 15, 2013 16:56
Alternative search and replace template for XSLT 1.0.
<!--
ALTERNATIVE SEARCH & REPLACE
string: The text to be evaluated
replace: The character or string to look for in the above string
with: What to replace it with
Slightly more long winded approach if that's how you prefer to roll.
-->
<xsl:template name="string-replace">
@ijy
ijy / search-and-replace.xsl
Created September 15, 2013 16:35
XSLT 1.0 search and replace template.
<!--
SEARCH & REPLACE
string: The text to be evaluated
search: The character or string to look for in the above string
replace: What to replace it with
The output will neatly concatenate the string with replacements made.
-->
<xsl:template name="search-and-replace">
@ijy
ijy / 1.pagination.xsl
Created September 15, 2013 16:24
Modified pagination utility for Symphony CMS to (optionally) allow it to work with other query string parameters. Add the pagination utiltity, import it into your page template, pass in required (and optional) paramaters, style with CSS. Examples included.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Name: DATA SOURCE PAGINATION
Version: 1.5
Author: Nick Dunn <nick@nick-dunn.co.uk>,
Nils Hörrmann <post@nilshoerrmann.de>,
Ian Young <i.young@me.com>
URL: https://gist.github.com/ijy/6572186
@ijy
ijy / 1.pagination.xsl
Last active December 23, 2015 03:09
Original Symphony CMS pagination utility by Nick Dunn. Add the pagination utiltity, import it into your page template, pass in required (and optional) paramaters, style with CSS. Examples included.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Name: DATA SOURCE PAGINATION
Version: 1.4 with custom elements
Author: Nick Dunn <nick@nick-dunn.co.uk>, extended by Nils Hörrmann <post@nilshoerrmann.de>
URL: http://symphony-cms.com/downloads/xslt/file/20482/
Required Parameters:
@ijy
ijy / store-shipping-zones.php
Created August 26, 2013 12:01
A custom shipping plugin for Exp:resso Store (v1) allowing you to group shipping rules for various countries. Place this class in a file named: store/libraries/store_shipping/store_shipping_zones.php
class Store_shipping_zones extends Store_shipping_driver
{
/**
* Calculate the shipping total for an order.
* Use print_r($order) to see all the fields available to you.
* The fields available also match those in the Checkout tag:
* http://exp-resso.com/docs/store/tags/checkout.html
*
* @param array $order
*/
@ijy
ijy / sym-merge-get-param-arrays.php
Last active December 21, 2015 14:19
A Symphony Event (for 2.3x) which looks at the query string produced from a front-end form submission using a GET request and for any keys which have multiple values it wraps them up into a single XML element in the parameter pool for use within datasources. The numeric ones are left in place.
<?php
require_once(TOOLKIT.'/class.event.php');
Class eventmerge_get_param_arrays extends Event {
public $eParamFILTERS = array(
);
@ijy
ijy / symphony-2.3x-htaccess
Created August 22, 2013 16:55
Symphony 2.3x .htaccess file
### Symphony 2.3.x ###
Options +FollowSymlinks -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
### SECURITY - Protect crucial files
RewriteRule ^manifest/(.*)$ - [F]

A Symphony Workflow

I'm describing my workflow in these articles, before I start my next Symphony project. Mostly for myself, to iron out my recurring problems, it is based on solid git techniques, taking heed of advice learned from Symphony community members, many many tips on the web, and flicking through the pages of O'Reilly's Version Control with git.

The core aim of this article, is to get a good Symphony development and deployment environment using git as the basis for the organisation, and have it written down for reference.

This workflow can be applied to any project, in theory, that has a starting point being a private remote git repo.

Disclaimer

@ijy
ijy / ext.store_discount_batch.php
Created August 6, 2013 10:52
For Expresso Store v1. Add a $10 discount for every item in the cart which for three or more items. In Store v2 this is now included natively.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Store Discount Extension
*
* @package ExpressionEngine
* @subpackage Addons
* @category Extension
* @author Ian Young
* @link http://
@ijy
ijy / ext.store_discount.php
Created August 6, 2013 10:44 — forked from elivz/ext.store_discount.php
For Expresso Store v1. Every product added to the basket gets a $10 discount. In Store v2 this is now included natively.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Store Discount Extension
*
* @package ExpressionEngine
* @subpackage Addons
* @category Extension
* @author Eli Van Zoeren
* @link http://elivz.com