- Control Panel Body Classes plugin
- Control Panel JavaScript plugin
- Control Panel CSS plugin
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 | |
namespace modules; | |
use Craft; | |
use craft\controllers\EntriesController; | |
use craft\controllers\UsersController; | |
use yii\base\ActionEvent; | |
use yii\base\Event; | |
use yii\base\Module; | |
use yii\web\ForbiddenHttpException; |
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 | |
// In general.php define an alias: | |
'aliases' => [ | |
'@baseUrl' => getenv('CRAFTENV_BASE_URL') | |
], | |
// In the CP, set the Base URL for each site to @baseUrl/ | |
// When previewing, the CP will therefore always use the hostname the editor logged into as the base url for the preview | |
// (that happens with 'new' entries anyway regardless of base url, but existing entries use base url). |
This is a quick (rough) guide on how to protect a Serverpilot pilot app with auth basic
I wrote a quick script for those that provision servers often enough.
To get this to work take the following steps
- Log into your server as
root
- Get script
wget https://gist.githubusercontent.com/nfourtythree/90fb8ef5eeafdf478f522720314c60bd/raw/disable-strict-mode.sh
- Make is executable
chmod +x disable-strict-mode.sh
- Run the script
./disable-strict-mode.sh
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
This is now part of craft-scripts: | |
https://github.com/nystudio107/craft-scripts |
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 | |
namespace Craft; | |
class MyPluginController extends BaseController | |
{ | |
// This lets anyone run the controller actions we specify, useful for CRON etc | |
protected $allowAnonymous = array('actionMigrate'); | |
/** |
I've moved this to a proper GitHub project at https://github.com/andrewfairlie/good-feedback
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 | |
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
function postToMedium($data=array()) { | |
$user_id = "XXXX"; | |
$accessToken = "XXXX"; | |
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
public function modifyEntrySources(&$sources, $context) | |
{ | |
if ($context === 'index') { | |
foreach ($sources as &$source) { | |
if (!isset($source['label'])) { | |
continue; | |
} | |
$total = craft()->elements->getTotalElements($source['criteria']); | |
$source['label'] .= ' ('. $total .')'; | |
} |
NewerOlder