Skip to content

Instantly share code, notes, and snippets.

@chriwo
chriwo / tt_address_selectBox.js
Last active June 18, 2018 08:14
Build a select box of tt_address user. Changes in select box get full information of tt_address user, e.g. phone, address, email. The CSS classes and id's would be work with twitter bootstrap. TYPO3 v6.2
jQuery(document).ready(function() {
var dselect = jQuery('.contact-select').val();
jQuery('.contact div#contact-' + dselect).show();
jQuery('.contact-select').on('change', function() {
var cselect = jQuery(this).val();
jQuery('.contact div.contact-wrapper').hide();
jQuery('.contact div#contact-' + cselect).show();
@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 / htaccess
Last active February 1, 2018 12:36
Redirect all to index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteRule ^.*$ /index.html [L,R=301]
@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 / realurl_conf.php
Last active June 29, 2018 07:12
RealUrl Multidomain setup with configuration for tx_news. You could copy & paste the code, but it's important to change line 4 and line 133. Replace the domain name and the PAGE_UID. In line 133 it's needed to replace the PAGE_UID with the page number of the detail news page.
<?php
$domainConfiguration = [
'www.first-domain.com' => PAGE_UID,
//'www.second-domain.com' => PAGE_UID,
//'www.third-domain.com' => PAGE_UID
];
$txRealUrlConfiguration = [
'init' => [
@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 <[email protected]>
* 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 <[email protected]>
*
* All rights reserved