Skip to content

Instantly share code, notes, and snippets.

@paulrohrbeck
paulrohrbeck / typo3_ts_pagetitle_class.txt
Last active December 27, 2015 11:39
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.
# 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 November 13, 2013 10:09
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)
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 November 13, 2013 10:17
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.
-------------------------------
- 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
@paulrohrbeck
paulrohrbeck / typo3_hide_tcefields.txt
Created November 15, 2013 09:24
TYPO3, Typoscript: Hide/rename backend fields
http://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TCEform/Index.html
TCEFORM.[put the table name here].[put the field name here].disabled = 1
@paulrohrbeck
paulrohrbeck / typo3_randomimage
Last active January 1, 2016 13:49
TYPO3: Random image, not cached, pulled from media reference on page record.
lib.randomImage = COA_INT
lib.randomImage {
10 = IMAGE
10 {
file {
import = uploads/media/
import.data = levelmedia:-1, slide
import.listNum = rand
width = 1000
height = 500c
@paulrohrbeck
paulrohrbeck / readme.md
Last active January 2, 2016 01:19
TYPO3, TypoScript: This little snippet changes the title tag for the news plugin (tx_news, not tx_ttnews) when just one page is used for the plugin, displaying both list and detail view. Without this the title would just be "Blog" (or whatever you set in the backend). Please note that for the single view you may use the built-in TitleTagViewHelp…

TYPO3, TypoScript: This little snippet changes the title tag for the news plugin (tx_news, not tx_ttnews) when just one page is used for the plugin, displaying both list and detail view. Without this the title would just be "Blog" (or whatever you set in the backend). Please note that for the single view you may use the built-in TitleTagViewHelper.

Results in:

  • Blog (main page)
  • Blog - page 2 (pagination, also see pagebrowse extension)
  • 12/2013 - Blog (Archive by month)
  • 12/2013 - page 2 - Blog
  • General - Blog (category)
  • General - page 2 - Blog (category)
@paulrohrbeck
paulrohrbeck / typo3_typoscript_register
Last active January 2, 2016 15:19
TYPO3, TypoScript: navigation using 'Foundation' classes. In the register we calculate which column class the div should get. (@see http://lists.typo3.org/pipermail/typo3-english/2010-December/072420.html)
lib.navigation.secondary = HMENU
lib.navigation.secondary {
entryLevel = 1
stdWrap.dataWrap = <div class="row large-10 small-centered large-centered columns">|</div>
1 = TMENU
1 {
NO {
@paulrohrbeck
paulrohrbeck / typo3_additional_classes
Created January 31, 2014 23:31
TYPO3, TypoScript: Additional classes for tt_content rendered elements
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_style_selector
Created March 7, 2014 00:45
Adobe CQ/AEM: Add style selector for text component. To be added in .content.xml under /etc/designs/...abc.../
<basepage jcr:primaryType="nt:unstructured">
<mainParagraph
jcr:lastModified="{Date}2014-01-17T17:44:04.712-08:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
components="[group:General,group:Columns,group:Form]">
<section jcr:primaryType="nt:unstructured"/>
<text jcr:primaryType="nt:unstructured">
<cq:styles jcr:primaryType="nt:unstructured">
<columns
@paulrohrbeck
paulrohrbeck / aem_filter_tag
Created March 25, 2014 17:16
Adobe CQ/AEM: Add filter by tag to the query builder (asset share)
<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"