Skip to content

Instantly share code, notes, and snippets.

View hertsch's full-sized avatar

Ralf Hertsch hertsch

View GitHub Profile
@hertsch
hertsch / sample-wb-load-jquery.html
Last active August 29, 2015 13:56
Load jQuery from the kitFramework Library in a WebsiteBaker Template
<script type="text/javascript" src="<?php echo WB_URL; ?>/kit2/extension/phpmanufaktur/phpManufaktur/Library/Library/jquery/jquery/1.10.2/jquery.min.js"></script>
@hertsch
hertsch / sample-twig-load-jquery.twig
Created February 9, 2014 10:28
Twig sample: load jQuery from the Library
<script type="text/javascript" src="{{ LIBRARY_URL ~ '/jquery/jquery/1.10.2/jquery.min.js' }}"></script>
<h1>In Kürze: Sucht ist eine Krankheit</h1>
<p>Zu viel trinken, zu viel rauchen, zu viele Pillen, zu viel kiffen, zu viel spielen... Sind das nur schlechte Eigenschaften? Nein, das "zu viel" heißt auch "nicht aufhören können" und wirkt manchmal krankhaft. Es ist tatsächlich Krankheit und sie wird umgangssprachlich "Sucht" und präziser "Abhängigkeitserkrankung" genannt.</p>
"admin": {
"import": {
"enabled": true,
"data": {
"handling": "CLEAN_UP",
"htmlpurifier": {
"enabled": true,
"config": {
"URI.MakeAbsolute": true,
"AutoFormat.RemoveEmpty": true,
"language": {
"select": false,
"default": "DE",
"support": {
"DE": {
"code": "DE",
"name": "German"
},
"EN": {
"code": "EN",
@hertsch
hertsch / sample.imagetweak.available.php
Last active August 29, 2015 13:55
Sample: check if the imageTweak filter is available
<?php
// check if the imageTweak filter is available
if (file_exists(WB_PATH.'/modules/kit_framework/framework_info.php')) {
require_once WB_PATH.'/modules/kit_framework/framework_info.php';
if (kitFramework_isFilterAvailable('imageTweak')) {
echo '~~ filter:imageTweak ~~';
}
}
?>
@hertsch
hertsch / sample.flexcontent.category.twig
Created January 15, 2014 04:03
Sample for a Twig template structure
{% if loop.index < 3 %}
{# expose the first two items in columns #}
{% include '@phpManufaktur/flexContent/Template/default/command/category.exposed.twig' %}
{% endif %}
@hertsch
hertsch / sample.config.imagetweak.json
Last active January 2, 2016 09:48
imageTweak configuration sample
{
"enabled": true,
"image": {
"alt": {
"default": "- no image description available -",
"set": true
},
"title": {
"default": "- no image description available -",
"set": true
@hertsch
hertsch / kitfilter_imagetweak_en.md
Last active January 2, 2016 08:29
Helpfile for imageTweak

##~~ filter:imageTweak ~~

Attention: imageTweak provide a kitCommand and a kitFilter, this is the helpfile for the kitFilter.

The kitFilter ~~ filter:imageTweak ~~ check all images at the actual shown page of your Content Management System, check the sizes, re-sample them if necessary, reduce the traffic and speed up your Website.

imageTweak does not need any parameters or special handling. Just place the kitFilter

~~ filter:imageTweak ~~
@hertsch
hertsch / changed_search.php
Last active January 2, 2016 06:49
Remove kitCommand command line from CMS search result
if ($query->numRows() > 0) {
if ($res = $query->fetchRow()) {
// remove all kitCommands from the content
preg_match_all('/(~~)( |&nbsp;)(.){3,512}( |&nbsp;)(~~)/', $res['content'], $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$res['content'] = str_replace($match[0], '', $res['content']);
}
$mod_vars = array(