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
$app['upload'] = $app->share( | |
$app->extend( | |
'upload', | |
function ($upload, $app) { | |
$upload->setSanitizerCallback( | |
function ($filename) use () { | |
// do custom sanitising here... | |
} | |
); |
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
{% for name,field in record.contenttype.fields %} | |
{% if field.type == 'text' %} | |
{{ record.get(name) }} | |
{% endif %} | |
{% endfor%} |
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
var CKEDITORPluginExtras = false; | |
if (typeof(CKEDITOR) != 'undefined' ) { | |
CKEDITOR.on('instanceReady',function(event, instance){ | |
if (CKEDITORPluginExtras) { | |
return; | |
} | |
var config = event.editor.config; | |
CKEDITOR.instances.body.destroy(); |
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
# Add to bottom of fields within showcases | |
repeat: | |
type: repeater | |
group: repeats | |
limit: 3 | |
prefix: "<p>This allows you to create multiple sets of fields. Use the add button at the bottom to create a new empty set.</p>" | |
postfix: "<p>This is a postfix</p>" | |
fields: | |
reptitle: | |
type: text |
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
$app['upload'] = $app->extend('upload', function ($handler, $app) { | |
if ($app['request']->get('contenttypeslug') && $app['request']->get('id')) { | |
$handler->setPrefix("/".$app['request']->get('contenttypeslug')."/".date("Y-m")); | |
} | |
return $handler; | |
}); |
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
SELECT content.*, GROUP_CONCAT(DISTINCT entries.to_id) as entries FROM bolt_showcases content LEFT JOIN bolt_relations entries ON ((content.id = entries.from_id) AND (entries.from_contenttype = :boltname) AND (entries.to_contenttype = :field)) OR ((content.id = entries.to_id) AND (entries.to_contenttype = :boltname) AND (entries.from_contenttype = :field)) GROUP BY content.id | |
SELECT content.*, GROUP_CONCAT(DISTINCT entries.to_id) as entries FROM bolt_showcases content LEFT JOIN bolt_relations entries ON content.id = entries.from_id AND entries.from_contenttype='showcases' AND entries.to_contenttype='entries' GROUP BY content.id |
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
## in sections.yml or at the top of contenttypes.yml | |
# inside a fields block in contenttypes.yml | |
people: | |
type: repeater | |
limit: 3 | |
fields: | |
name: | |
type: text | |
class: large |
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 | |
// Appears in your bootstrap file, before the call to $app->run() | |
$app['upload'] = $app->extend('upload', function ($handler, $app) { | |
if ($app['request']->get('contenttype') == 'pages') { | |
if ($app['request']->get('contenttypeslug') && $app['request']->get('id')) { | |
$handler->setPrefix("/".$app['request']->get('contenttypeslug')."/".$app['request']->get('id')); | |
} | |
} | |
return $handler; |
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
1: Make this class | |
<?php | |
namespace Mysite\Bolt; | |
use Bolt\Application; | |
use Bolt\BaseExtension; | |
class GetEventsExtension extends BaseExtension |
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 MySite\Bolt\Provider; | |
use Silex\ServiceProviderInterface; | |
use Silex\Application; | |
use Symfony\Component\Translation\Loader\YamlFileLoader; | |
/** | |
* | |
*/ |