Skip to content

Instantly share code, notes, and snippets.


Fritz Michael Gschwantner fritzmg

View GitHub Profile
fritzmg / www_klack_de.xml
Last active Dec 23, 2015
UPDATE: Use instead || MediaPortal WebEPG grabber file for
View www_klack_de.xml
<?xml version="1.0" encoding="utf-8"?>
<Info language="de" availableDays="14" timezone="W. Europe Standard Time" version="2.1.0" />
<Channel id="13TH STREET Universal" siteId="112" />
<Channel id="3sat" siteId="1" />
<Channel id="Animal Planet" siteId="73" />
<Channel id="Animax" siteId="171" />
<Channel id="ANIXE HD" siteId="4" />
<Channel id="ARTE" siteId="6" />
fritzmg / filetags.php
Created Jul 9, 2015
Replaces file paths like "files/lorem/ipsum/foo.jpg" in Contao text elements with {{file::…}} insert tags.
View filetags.php
* Contao Open Source CMS
* Copyright (c) 2005-2015 Leo Feyer
* @license LGPL-3.0+
fritzmg / nav_switch.html5
Created Jul 13, 2015
Contao nav_default Template, which allows you to switch to the same subpage within a different "category". Simply create a new custom navigation module, select the pages that act as "category roots" and assign this template. You also need to use folder URLs and the page aliases must be the same (except for the first part, i.e. the "category").
View nav_switch.html5
<?php global $objPage; ?>
<ul class="<?= $this->level ?>" role="<?= ($this->level == 'level_1') ? 'menubar' : 'menu' ?>">
<?php foreach ($this->items as $item): ?>
// get the current page's alias and remove its first part
$arrAlias = explode('/', $objPage->alias);
fritzmg / isotope_cart_ajax.js
Last active Aug 27, 2015
Contao Isotope cart AJAX actions
View isotope_cart_ajax.js
// or use instead
$.fn.getPath = function () {
if (this.length != 1) throw 'Requires one element.';
var path, node = this;
while (node.length) {
var realNode = node[0], name = realNode.localName;
if (!name) break;
fritzmg / j_tablesort.html5
Created Nov 21, 2015
j_tablesort template which includes the default sort option provided by Contao
View j_tablesort.html5
// Add the tablesorter style sheet
$GLOBALS['TL_CSS'][] = 'assets/jquery/tablesorter/' . $GLOBALS['TL_ASSETS']['TABLESORTER'] . '/css/tablesorter.css|static';
<script src="<?= TL_ASSETS_URL ?>assets/jquery/tablesorter/<?= $GLOBALS['TL_ASSETS']['TABLESORTER'] ?>/js/tablesorter.js"></script>
<script src=""></script>
fritzmg / nav_newscategories.html5
Created Nov 26, 2015
nav_newscategories template for the Contao news_categories extension which also takes the jumpTo page into account
View nav_newscategories.html5
<ul class="<?php echo $this->level; ?>">
<?php foreach ($this->items as $item): ?>
// build link to jumpTo page
if( $item['jumpTo'] )
$objJump = \PageModel::findByPk( $item['jumpTo'] );
if( $objJump !== null )
fritzmg / be_rebuild_index.html5
Last active Aug 23, 2016
Contao RebuildIndex template with more feedback
View be_rebuild_index.html5
<div id="tl_maintenance_index" class="maintenance_<?= $this->isActive ? 'active' : 'inactive' ?>">
<h2 class="sub_headline_index"><?= $this->indexHeadline ?></h2>
<?php if ($this->indexMessage): ?>
<div class="tl_message">
<p class="tl_error"><?= $this->indexMessage ?></p>
<?php endif; ?>
fritzmg /
Last active Aug 16, 2019
Use fineuploader for news teaser images in Contao

Use fineuploader for news teaser images in Contao

Using these instructions you can replace the default file selector for news teaser images with a direct upload button. This upload button is implemented using the terminal42/contao-fineuploader extension.

First install the extension via the Composer package management for Contao (Packagist: terminal42/contao-fineuploader). Then insert the following content into contao/dca/tl_news.php:

$GLOBALS['TL_DCA']['tl_news']['fields']['singleSRC']['inputType'] = 'fineUploader';
$GLOBALS['TL_DCA']['tl_news']['fields']['singleSRC']['eval'] = [
    'storeFile' => true, 
fritzmg /
Created Mar 27, 2016
How to cleanly switch from composer back to the old ER2 in Contao

How to cleanly switch from composer back to the old ER2 in Contao

The information given here in the German Contao Wiki can lead to problems. If you want to cleanly switch back to the old ER2 in Contao, you need to follow these steps. But before doing so, you should note down all the extensions that you still need after switching back and you should make sure that these extensions are available in the ER2 and still compatible with your Contao version.

  1. remove all modules and assets from installed extensions (see below)
  2. go to System » Settings » Inactive extensions, check [!composer] and uncheck [repository]
  3. reinstall all needed extensions via the extension repository
  4. once you are sure that everything is working as expected, you can delete the folder /composer and /system/modules/!composer
fritzmg /
Last active Jan 2, 2018
Previous and next events in the event_full template of Contao.

Contao Event Pagination

This event_full template creates a previous and next pagination for events. It uses the same HTML structure as the default pagination template. Of course you can change that to your needs. Simply download the event_full.html5 template and put it in your /templates directory.

Known limitations:

  • It ignores the start and end field.
  • It is limited to events from the same calendar. Otherwise the target URL might be wrong.
  • It will not work if the auto_item parameter is disabled.
You can’t perform that action at this time.