Skip to content

Instantly share code, notes, and snippets.

@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 / delete-translation-projects.groovy
Last active March 7, 2017 19:20
AEM: delete all translation projects and associated data (to be executed in Groovy console)
import com.adobe.cq.projects.api.*;
import org.apache.jackrabbit.api.security.user.*;
ProjectFilter pf = new ProjectFilter();
Boolean dryRun = true;
List<String> templates = Arrays.asList("/libs/cq/core/content/projects/templates/create-translation-project");
pf.setProjectTemplates(templates);
ProjectManager pm = resourceResolver.adaptTo(ProjectManager.class);
@paulrohrbeck
paulrohrbeck / aem_querybuilder_snippets
Created October 31, 2014 16:56
AEM/CQ Querybuilder snippet
Find pages with CUG on it:
path=/content
type=cq:PageContent
property=cq:cugEnabled
property.value=true
@paulrohrbeck
paulrohrbeck / aem_find_i18n_strings.txt
Last active August 12, 2016 17:36
AEM: Finds all i18n strings in Sightly HTML files
# Run in parent Maven project to find all:
grep -riohE '\$\{(.)* ?@ ?i18n\}' .
# Example result: ${'Filter' @ i18n}
@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 / 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_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 / 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 / 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_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');