Skip to content

Instantly share code, notes, and snippets.

@chriwo
chriwo / responsiveNavigation.js
Created April 29, 2015 07:01
Duplicates a main navigation point into sub level and sets the Twitter Bootstrap "drop" options. As a result, one obtains in the MobileView a "normal" Bootstrap dropdown menu. In Desktop View the dropdown options are removed and you can use the menu with MouseHover effects. At an interval, the size of the browser window is checked, which adapts …
(function($) {
$.fn.responsiveNavigation = function() {
// check if dropdown navigation in mobile mode
var responsiveActive = $('li.responsive').length;
// window size lower 767px and nav is not in mobile mode
if ($(window).width() < 767 && !responsiveActive) {
$(this).each(function() {
$(this).parent().children('a').clone().prependTo($(this)).wrap("<li class=\"responsive\"></li>");
@chriwo
chriwo / TCA_FAL.php
Last active November 16, 2015 12:46
Create a new FAL element in TCA. To use it, change the current field name "new_fal_image" and the table name "YOUR TABLE NAME", so that TYPO3 find your image
'columns' => array(
'new_fal_image' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'FAL image label',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'media',
array(
'appearance' => array(
'showPossibleLocalizationRecords' => 1,
@chriwo
chriwo / db_delete_records.php
Last active August 7, 2016 11:56
Deletes all records in the database that are marked as deleted.
<?php
/****************************************************
* db_delete_records.php
* Author: Christian Wolfram <c.wolfram@chriwo.de>
* Date: 12-11-2014
*
* Deletes all records in the database that
* are marked as deleted.
*
* Run from root directory of your TYPO3
@chriwo
chriwo / FlexForm.xml
Last active August 7, 2016 14:16
Create simple timetable with gridelements
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Allgemein</sheetTitle>
@chriwo
chriwo / constants.txt
Last active August 14, 2016 18:44
Append categories to main menu
appendCategoryMenu {
# cat=appendCategoryMenu/navigation/10; type=string; label=complete string of navigation lib
menuLibary =
# cat=appendCategoryMenu/navigation/20; type=int+; label=UID of navigation point
menuPid =
# cat=appendCategoryMenu/navigation/30; type=int+; label=UID of category pages
defaultCategoryPid =
@chriwo
chriwo / ActionFrontendViewHelper
Created November 9, 2016 10:26
Uri action frontend viewhelper to generate FE links from BE, e.g. in a scheduler task
<?php
namespace ChriWo\Company\ViewHelpers\Uri;
/***************************************************************
*
* Copyright notice
*
* (c) 2016 Christian Wolfram <c.wolfram@chriwo.de>
*
* All rights reserved
@chriwo
chriwo / FE.html
Created December 21, 2016 07:23
TCA SelectBox Value and output in FE with language file
...
<!--
jobTitle is the object property and equal with the TCA definition job_title
-->
<f:translate key="jobtitle.{jobItem.jobTitle}"/>
...
@chriwo
chriwo / EmConfiguration.php
Last active January 20, 2017 19:46
Example to use the configuration options in extension manager
<?php
namespace VENDOR\YourExtKey\Domain\Model\Dto;
/**
* Class EmConfiguration
*
* @package TYPO3
* @subpackage tx_extkey
*/
class EmConfiguration
@chriwo
chriwo / constant.ts
Last active May 18, 2017 21:12
TypoScript Language Menu
lib.language {
# select the language uid of languages in menu
uidList = 0,1,2,3,4
# language uid, if no languages in url given
normalWhenNoLanguage = 0
# set languages param in them order how "uidList"
addParams = &L=0 || &L=1 || &L=2 || &L=3 || &L=4
@chriwo
chriwo / index.html
Created May 23, 2017 06:09
Bootstrap 3.x column ordering
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>