A Dashing widget for displaying the number of visitors to your website over a specified timeframe, as reported by Google Analytics
This file contains hidden or 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 | |
class MyDataObjectAdmin extends ModelAdmin { | |
private static $managed_models = array('MyDataObject'); // Can manage multiple models | |
private static $url_segment = 'my-data-object'; // Linked as /admin/my-data-object/ | |
private static $menu_title = 'My DataObjects'; | |
public function getSearchContext() { |
This file contains hidden or 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 | |
public function duplicate() { | |
$items_to_duplicate = array( | |
'Images', | |
'Somehting' | |
); | |
$page = parent::duplicate(); |
This file contains hidden or 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 | |
/** | |
* Configure SilverStripe using apache environment variables | |
* Usage: Put "require_once('conf/ConfigureFromEnv.php');" into your _config.php file. | |
* Example Apache vhost: | |
* <VirtualHost *:80> | |
* ... | |
* SetEnv SS_ENVIRONMENT_TYPE dev | |
* SetEnv SS_DEFAULT_ADMIN_USERNAME admin |
This file contains hidden or 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
# My ./config directory in silverstripe looks like this: | |
# ./503.php <- a 503 Maintainance page | |
# ./_ss_environment.php <- the production environment settings | |
# ./deploy.rb <- is the recipe below | |
# | |
# Application settings | |
set :application, "domain.com" | |
set :shared_children, %w(assets) |
This file contains hidden or 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
HtmlEditorConfig::get('cms')->setOptions(array( | |
"skin" => "default", | |
"style_formats" => array( | |
array( | |
"title" => "Lead", | |
"selector" => "p", | |
"classes" => "lead" | |
), | |
array( | |
"title" => "Subheader", |
This file contains hidden or 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 | |
/** | |
* Configure SilverStripe from the _ss_environment.php file. | |
* | |
* Edit this file and rename from _ss_environment.sample.php to _ss_environment.php. | |
* Put "require_once('conf/ConfigureFromEnv.php');" into your _config.php file. | |
* http://doc.silverstripe.org/framework/en/trunk/topics/environment-management | |
*/ |
This file contains hidden or 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
{ | |
"name": "{{ YOUR NAMESPACE }}/{{ PACKAGE NAME }}", | |
"type": "{{ silverstripe-module}} || {{ silverstripe-theme}}", | |
"description": "SilverStripe", | |
"keywords": ["silverstripe", "keyword"], | |
"license": "BSD-3-Clause", | |
"authors": [{ | |
"name": "{{ AUTHOR NAME }}", | |
"homepage": "{{ AUTHOR WEBSITE }}" | |
}], |
This file contains hidden or 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
//parameter or returns an empty string | |
jQuery.getURLParameter = function(name) { | |
return decodeURI( | |
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, ''])[1] | |
); | |
}; |
This file contains hidden or 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 | |
class MiniCart extends DataObjectDecorator { | |
... | |
public static function MiniCartItemShortcodeHandler($attributes, $content = null, $parser = null) { | |
if(empty($attributes['name']) || empty($attributes['price'])) { | |
return; |