This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// generate a url segment | |
$this->Slug = SiteTree::create()->generateURLSegment($this->Title); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// make main tab fields read-only | |
$main_fields = $fields->fieldByName('Root.Main')->Fields(); | |
foreach ($main_fields as $field) { | |
$main_fields->push($field->performReadonlyTransformation()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Centre a child block vertically within its parent. | |
* Works in IE9+ and other browsers. http://caniuse.com/#feat=transforms2d | |
*/ | |
parent { | |
position: relative; /* create a positioning context */ | |
} | |
child { | |
position: absolute; | |
top: 50%; /* position the top of the element to the middle of the parent */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Centre and crop an image with a fixed height */ | |
.crop { | |
position: relative; /* provide a positioning context */ | |
overflow: hidden; | |
height: 200px; /* make space */ | |
} | |
.crop img { | |
position: absolute; | |
left: -100%; /* anchor the image corners outside the viewable area (increase for large images) */ | |
right: -100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* DataObjectExample | |
* | |
* Example description. | |
*/ | |
class DataObjectExample extends DataObject | |
{ | |
/** @var array Database fields */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** PageExample */ | |
/** | |
* PageExample | |
* | |
* Example description. | |
*/ | |
class PageExample extends Page | |
{ | |
/** @var array Database fields */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prevent webkit autofill style | |
&:-webkit-autofill, | |
&:-webkit-autofill:focus { | |
-webkit-box-shadow: 0 0 0 100px #fff inset; | |
-webkit-text-fill-color: #333; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array_map(function($o) { return $o->Name; }, $arrayOfObjects); |