Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Rohrbeck paulrohrbeck

View GitHub Profile
@paulrohrbeck
paulrohrbeck / typo3_additional_classes
Created Jan 31, 2014
TYPO3, TypoScript: Additional classes for tt_content rendered elements
View typo3_additional_classes
tt_content.stdWrap.innerWrap.cObject.default.20.40.20 = CASE
tt_content.stdWrap.innerWrap.cObject.default.20.40.20 {
key.field = layout
1 = TEXT
1.value = class-name-here
if {
value = textpic
equals.field = CType
@paulrohrbeck
paulrohrbeck / aem_filter_tag
Created Mar 25, 2014
Adobe CQ/AEM: Add filter by tag to the query builder (asset share)
View aem_filter_tag
<tab4
jcr:primaryType="nt:unstructured"
title="Filter"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<tagFilter
jcr:primaryType="cq:Widget"
name="./tagFilter"
fieldDescription="Add tags to filter the result set."
fieldLabel="Filter by tags"
@paulrohrbeck
paulrohrbeck / typo3_list_headlines
Created May 26, 2014
TYPO3: show list of headlines of a page
View typo3_list_headlines
### Sitebar ###
marks.sitebar = COA
marks.sitebar {
10 = CONTENT
10 {
table = tt_content
select.where = colPos = 0
select.languageField = sys_language_uid
renderObj = COA
renderObj {
@paulrohrbeck
paulrohrbeck / download_images.py
Created Aug 1, 2014
Bulk download images from a defined page (including CSS selector).
View download_images.py
#!/usr/bin/python
"""
Download Images
"""
import optparse
from bs4 import BeautifulSoup
import requests
from urlparse import urlsplit
View adobecq_find_modified_nodes
path=/content
group.p.or=true
group.1_relativedaterange.property=jcr:lastModified
group.1_relativedaterange.lowerBound=-14d
group.1_relativedaterange.lowerOperation=>=
group.1_relativedaterange.upperBound=0
group.2_relativedaterange.property=jcr:created
group.2_relativedaterange.lowerBound=-14d
@paulrohrbeck
paulrohrbeck / mysql_find_duplicates
Created Sep 5, 2014
MySQL: find likely duplicates. SELECT first, then DELETE for safety. Alternatively, delete directly.
View mysql_find_duplicates
# Delete directly:
# -------------------------------------
DELETE
n1
FROM
`tableName` n1, `tableName` n2
WHERE
n1.id = n2.id AND
n1.lastmodifieddate = n2.lastmodifieddate AND
@paulrohrbeck
paulrohrbeck / typo3_optional_select
Created May 26, 2014
TYPO3: TCA make type „select“ optional with empty „option“
View typo3_optional_select
'feld' => array(
'exclude' => 0,
'label' => 'Feld Name',
'config' => array(
'type' => 'select',
'items' => Array (
Array("",0),
),
'foreign_table' => 'tx_deinetabelle',
'size' => 1,
@paulrohrbeck
paulrohrbeck / typo3_ts_pagetitle_class.txt
Last active Dec 27, 2015
TYPO3 / TypoScript: This snippet adds a class (eg. class="page-pagetitle") to the body tag of a TYPO3 page. The page title is dynamically pulled from the page properties, all non-word characters are removed and the title is transformed to lower case letters only.
View typo3_ts_pagetitle_class.txt
# add a class with the page title to the body tag:
bodyTag >
bodyTagCObject = TEXT
bodyTagCObject {
data = field:title
case = lower
stdWrap.replacement {
10 {
search = #\W#i
replace =
@paulrohrbeck
paulrohrbeck / typo3_extbase_parseRTE_controller.txt
Created Nov 13, 2013
TYPO3, Extbase: Instead of using the <f:format.html> ViewHelper to parse a RTE database field with the usual TypoScript lib, use it inside a controller. This is useful for instance if we pass something back as JSON. (this not special - it's actually borrowed from the original ViewHelper - I just wanted to keep it around in case I need it again)
View typo3_extbase_parseRTE_controller.txt
protected $cObj;
$this->cObj = t3lib_div::makeInstance('tslib_cObj');
$rteText = $this->cObj->parseFunc($anyObject->getDescription(), array(), '< lib.parseFunc_RTE');
@paulrohrbeck
paulrohrbeck / adobe_cq_dev_instance.txt
Created Nov 13, 2013
Adobe CQ/AEM: Setting up new dev author instance. Working doc to keep track to things I need to do for setting up a local dev env.
View adobe_cq_dev_instance.txt
-------------------------------
- download/install "Content Compare and Import tool":
http://helpx.adobe.com/experience-manager/kb/support-tool-installation.html
https://www.adobeaemcloud.com/content/marketplace/marketplaceProxy.html?packagePath=/content/companies/public/adobe/packages/helper/Daycare%20Support%20Tools
-------------------------------
- disable Impression Importer:
http://helpx.adobe.com/experience-manager/kb/invalidpollingconfiguration.html
You can’t perform that action at this time.