Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kraftb
kraftb / gist:5684525
Created May 31, 2013 12:01
Selenium Task for migrating a TYPO3 mantis bugtracker entry to forge
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://forge.typo3.org/projects/extension-direct_mail/" />
<title>Migrate-bugentry-2-forge</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
@kraftb
kraftb / gist:7246693
Created October 31, 2013 09:19
HOWTO: Use Fluid templates sharing a layout but use different content areas
TITLE: Classical TYPO3 advanced fluid templating
TAGS: TYPO3 FLUIDTEMPLATE templating cObject
template-start.html and template-page.html should get referenced from within the FLUIDTEMPLATE content object.
start.html and page.html are the files supplied by your designer.
It goes to and fro from template-start.html to start.html
Probably Neos is called "N"eos because of this fact.
-------------- template-start.html / BEGIN --------------------

#How to start with TYPO3 in 2013 6.x Versions mentioned. Based on personal experience.

Prerequisites

You should at least be familar with HTML and CSS . Some JS knowledge is wise to have. After you are familar with these things you are able to dig into CMS business. If you don´t have a clue about it, you will get seriously frustrated.

If you dig into TYPO3 you need a lot of time to understand it.

Keep it in mind

@kraftb
kraftb / rewrite-staticfilecache.conf
Created November 20, 2013 20:36
TYPO3 apache htaccess supporting realurl and nc_staticfilecache
######################################################################
# Copyright notice
#
# (c) 2013 webconsulting business services gmbh (office@webconsulting.at)
# All rights reserved
#
# Based on work of various TYPO3 authors.
#
# This script is part of the TYPO3 project. The TYPO3 project is
In other solr plugins I saw the following code to add/reset the current term:
Stem stem = buffer.remove(0);
termAtt.copyBuffer(stem.getStem(), 0, stem.getStemLength());
termAtt.setLength(stem.getStemLength());
I use something the following code:
@kraftb
kraftb / gist:8844198
Created February 6, 2014 13:33
Counting TYPO3 pages in a branch
1. Create a table which helps us for this task:
CREATE TABLE ClosureTable (ancestor_id INT NOT NULL, descendant_id INT NOT NULL, path_length INT NOT NULL, PRIMARY KEY (ancestor_id, descendant_id));
2. Execute the following queries:
INSERT INTO ClosureTable (ancestor_id, descendant_id, path_length) SELECT 0,0,0;
INSERT INTO ClosureTable (ancestor_id, descendant_id, path_length) SELECT uid, uid, 0 FROM pages;
@kraftb
kraftb / gist:9257850
Created February 27, 2014 19:45
Debugging a T3D File
#!/usr/bin/php
<?php
/**
* Returns the next content part form the fileresource (t3d), $fd
*
* @param pointer $fd File pointer
* @param boolean $unserialize If set, the returned content is unserialized into an array, otherwise you get the raw string
* @param string $name For error messages this indicates the section of the problem.
* @return string Data string
@kraftb
kraftb / gist:9349612
Created March 4, 2014 16:19
An experiment for implementing git branach read access control
diff --git a/src/VERSION b/src/VERSION
new file mode 100644
index 0000000..56fa930
--- /dev/null
+++ b/src/VERSION
@@ -0,0 +1 @@
+v3.5.3.1-1-gf8776f5
diff --git a/src/gitolite-shell b/src/gitolite-shell
index 7a27cc0..f6a3442 100755
--- a/src/gitolite-shell
@kraftb
kraftb / generate-keypair.sh
Created April 1, 2014 16:49
Generate public/private keypair and output to stdout
#!/bin/bash
BITS=2048
# In one line:
# rm -f temp.key && ssh-keygen -t rsa -b 2048 -f temp.key -N "" -q && ssh-keygen -e -f temp.key -m PKCS8 | tr "\n" " " && echo && cat temp.key | tr "\n" " " && echo
# In multiple lines:
rm -f temp.key
ssh-keygen -t rsa -b $BITS -f temp.key -N "" -q
@kraftb
kraftb / gist:96e060bcf1c58f647594
Created June 17, 2014 14:48
HOWTO: Extend TYPO3/extbase Model with new fields
1. Create ext_tables.sql and add new fields as usual
2. Create Configuration/TCA/Overrides/tablename.php and extend TCA therein (before: ext_tables.php)
3. Add the following lines to your ext_localconf.php. Where the first argument of "registerImplementation" is the model class you would like to extend and the second argument is your own implementation.
$extbaseObjectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\Container\\Container');
$extbaseObjectContainer->registerImplementation('Tx_News_Domain_Model_NewsDefault', 'thinkopen_at\T3ff\Domain\Model\NewsT3ff');
4. Create your own implementation of the mode class and add the new properties + getters/setters for them