Skip to content

Instantly share code, notes, and snippets.

@kikmedia
kikmedia / pagetree.dca
Created September 22, 2012 06:36
simple pagetree dca
$GLOBALS['TL_DCA']['tl_page']['fields']['mymodule'] = array (
'label' => & $GLOBALS['TL_LANG']['tl_page']['mymodule'],
'exclude' => true,
'inputType' => 'pageTree',
'eval' => array (
'fieldType' => 'radio',
)
);
#Zugriff verbieten
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
#Zugriff erlauben
<IfModule !mod_authz_core.c>
@kikmedia
kikmedia / psd2png.js
Created April 15, 2013 12:22
Dead simple javascript, providing a basic Photoshop action for exporting PSD files as PNG. Just launch it on your desktop. I think, this one is Windows only.
#target "photoshop"
var outputWidth = 1024;
var inputFolder = Folder.selectDialog("Input folder");
var outputFolder = Folder.selectDialog("Output folder");
if (inputFolder != null && outputFolder != null) {
var files = inputFolder.getFiles("*.psd");
for (var i = 0; i < files.length; i++) {
@kikmedia
kikmedia / gist:5399057
Created April 16, 2013 19:53
Smoothscroll, just place into Contao - Layout (Javascript-Code)
<script type="text/javascript">
//when the dom is ready
window.addEvent('domready',function() {
//smooooooth scrolling enabled
//new SmoothScroll({ options }, window);
new SmoothScroll({ duration:500, offset: {'x': 0, 'y': -40} }, window); //500 milliseconds to get there
});
</script>
@kikmedia
kikmedia / gist:5419871
Created April 19, 2013 11:52
Show all template varaibles in Contao CMS
<pre>
<?php $this->showTemplateVars(); ?>
</pre>
@kikmedia
kikmedia / news_full_enhanced.html5
Created April 25, 2013 19:41
Contao FE template, creating a folder based on news id and listing the files
<div class="layout_full block<?php echo $this->class; ?>">
<h1><?php echo $this->newsHeadline; ?></h1>
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?php echo $this->datetime; ?>"><?php echo $this->date; ?></time> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<?php if ($this->hasSubHeadline): ?>
@kikmedia
kikmedia / gist:5902327
Created July 1, 2013 16:25
// show content in specific archives // Contao CMS
// show content in specific archives
<?php if ($this->archive == 'my_archive') { ?>
<img class="my_class" src="{{env::path}}tl_files/sys/assets/img/my_image.jpg" alt="" width="100" height="100" />
<?php } ?>
@kikmedia
kikmedia / gist:6309430
Created August 22, 2013 16:19
Configure Contao to preserve date and time on copying events via dcaconfig.php #Contao 2.x
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['addTime'][ 'eval']['doNotCopy']= false;
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['startTime'][ 'eval']['doNotCopy']= false;
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['endTime'][ 'eval']['doNotCopy']= false;
@kikmedia
kikmedia / gist:6310752
Created August 22, 2013 18:10
Configure Contao to disable the '(copy)-feature via langconfig.php #C2
$GLOBALS['TL_LANG']['MSC']['copyOf'] = '%s';
@kikmedia
kikmedia / gist:6390579
Created August 30, 2013 14:41
.htaccess für Piwik, um Indizierung zu verhindern, Caching einzustellen und ein paar andere häßliche Dinge zu tun.
############ headers and caching
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A86400
ExpiresByType image/gif A2592000
ExpiresByType text/javascript A2592000
</ifModule>
### HEADER CACHING