#TinyMCE hotkeys
Add 'format' to initalization:
formats: {text_center: {selector: 'p,h1,h2,h3,h4,h5,table', classes: 'text-center'}}
Then add the shortcut in 'setup':
setup: function (ed) {
| <?php | |
| namespace App\Tasks; | |
| use Psr\Log\LoggerInterface; | |
| use SilverStripe\Core\Injector\Injector; | |
| use SilverStripe\Dev\BuildTask; | |
| /** | |
| * BuildTask to cause Raygun to fire. This can be used to test Slack/Raygun integration. |
| <?php | |
| $url = 'https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&key=' . Config::inst()->get(GeocodeService::class, 'google_api_key'); | |
| $folder = Folder::find_or_make('maps'); | |
| $map = new Image(); | |
| $map->setFromString(file_get_contents($url), 'map.png'); | |
| $map->ParentID = $folder->ID; | |
| $map->write(); |
| <?php | |
| /** | |
| * Determine the best way to render the date based on conditions | |
| * | |
| * @return string | null | |
| */ | |
| public function getEventDate() | |
| { | |
| $start = DBDate::create()->setValue($this->owner->StartDate); |
| SELECT table_name, table_rows | |
| FROM INFORMATION_SCHEMA.TABLES | |
| WHERE TABLE_SCHEMA = 'db_name' | |
| ORDER BY table_rows desc; |
| #!/bin/sh | |
| PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` | |
| STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \.php` | |
| # Determine if a file list is passed | |
| if [ "$#" -eq 1 ] | |
| then | |
| oIFS=$IFS | |
| IFS=' |
#TinyMCE hotkeys
Add 'format' to initalization:
formats: {text_center: {selector: 'p,h1,h2,h3,h4,h5,table', classes: 'text-center'}}
Then add the shortcut in 'setup':
setup: function (ed) {
#TinyMCE style toggle button
First of all, you need to define a custom format:
formats: {
custom_format: {inline: 'span', attributes: {class: 'some_css_class'}}
}
Then you'll have to add a button to your toolbar:
| <? | |
| $htmlEditorConfig = HtmlEditorConfig::get('cms'); | |
| // Add half' and 'third' wrappers to tinyMCE (will appear in styles drop-down). | |
| $htmlEditorConfig->setOption('style_formats', [ | |
| [ | |
| 'title' => 'Half (md)', | |
| 'block' => 'div', | |
| 'wrapper' => true, |
| <?php | |
| //Set CMS style based on environment type | |
| if (Director::isDev()) {$sitemodeCSS = 'app/css/sitemode-dev.css';} | |
| if (Director::isTest()) {$sitemodeCSS = 'app/css/sitemode-test.css';} | |
| if (Director::isLive()) {$sitemodeCSS = 'app/css/sitemode-live.css';} | |
| Config::inst()->update('LeftAndMain', 'extra_requirements_css', [ | |
| $sitemodeCSS | |
| ]); |
| <?php | |
| SS_Report::add_excluded_reports( | |
| array( | |
| 'SideReport_BrokenRedirectorPages', | |
| 'SideReport_BrokenVirtualPages', | |
| 'SideReport_BrokenFiles', | |
| 'CwpStatsReport', | |
| 'SideReport_BrokenLinks', | |
| 'BrokenLinksReport', |