Skip to content

Instantly share code, notes, and snippets.

View muskie9's full-sized avatar

Nic muskie9

View GitHub Profile
@muskie9
muskie9 / gist:e765bc4b94c4d3e11b4d
Last active August 29, 2015 14:04
PageLink dropdown relation for linking in Layout
<?php
class HomePage extends Page {
private static $has_one = array(
'PageLink' => 'SiteTree'
);
public function getCMSFields() {
@muskie9
muskie9 / Page.php
Last active August 29, 2015 14:06 — forked from wernerkrauss/Page.php
<?php
class Page_Controller extends ContentController
{
private static $cdn_domain = 'cdn.mysite.com';
private static $cdn_rewrite = false;
public function handleRequest(SS_HTTPRequest $request, DataModel $model = null)
{
@muskie9
muskie9 / gist:55f8b8aae163c596d095
Created October 23, 2014 16:04
setTitle not found but works
CheckboxField::create('thisField')
->setTitle('this Title')
->performReadonlyTransformation()
<?php
class Locator extends Page {
private static $db = array(
'AutoGeocode' => 'Boolean',
'ModalWindow' => 'Boolean',
'Unit' => 'Enum("km,m","m")'
);
public function getCMSFields(){
$fields = new TabSet(
'Root',
$mainTab = new Tab(
'Main',
new NumericField(
'MaxVideosPerPage',
'Maximum Number of Videos per Page:',
$this->MaxVideosPerPage
Foo:
subfoo1:
Title: Foo 1
Prefix: FOO
subfoo2:
Title: Foo 2
Prefix: SFOO
Bar:
subbar1:
/**
* This demo was prepared for you by Petr Tichy - Ihatetomatoes.net
* Want to see more similar demos and tutorials?
* Help by spreading the word about Ihatetomatoes blog.
* Facebook - https://www.facebook.com/ihatetomatoesblog
* Twitter - https://twitter.com/ihatetomatoes
* Google+ - https://plus.google.com/u/0/109859280204979591787/about
* Article URL: http://ihatetomatoes.net/simple-parallax-scrolling-tutorial/
*/
$detector = new Mobile_Detect;
if(!$detector->isMobile() && !$detector->isTablet()){
//requirements here
}
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<identity>
<version number="$Revision: 1.122 $"/>
<generation date="$Date: 2009/06/15 03:46:24 $"/>
<language type="pl"/>
</identity>
<localeDisplayNames>
<localeDisplayPattern>
<localePattern>{0} ({1})</localePattern>
<?php
/**
*
* @package FoxyStripe
*
*/
class ProductCategory extends DataObject {
private static $db = array(