Configuration
Look's options apply
Everything Look offers applies unchanged: the default scale and maximum
height of the previews in the extension configuration, and the feature flags
edit (click to edit), allow (Camino's
JavaScript inside the frame) and allow (videos). See the
Look documentation.
The preview templates
The site set maps the Camino content types to two templates.
Resources/ serves all types:
<look:backend.contentPreview
record="{record}"
bodyClass="{look:site.setting(pageUid: record.pid, name: 'camino.colorScheme')}"
css="{0: 'EXT:theme_camino/Resources/Public/Css/main.css'}"
js="{0: 'EXT:theme_camino/Resources/Public/JavaScript/main.js'}" />
recordmakes Look render the element with the frontend TypoScript of its page in a separate request.bodyputs the colour scheme from the site settings on the body of the preview frame, as Camino does on the website.Class cssandjsload Camino's stylesheet and script inside the frame. The script only runs whenallowis enabled.Site Scripts
Resources/ is the same with
height="340" and serves camino_. Teasers in the
sidebar can get tall (image plus text); the fixed height keeps the page module
compact, the fade-out shows editors that the element continues.
Adjusting the mapping
The mapping is plain page TSconfig in the site set:
mod.web_layout.tt_content.preview {
camino_hero = EXT:look_camino/Resources/Private/Templates/Preview/Content.html
camino_textmedia_teaser = EXT:look_camino/Resources/Private/Templates/Preview/Teaser.html
}
To change the height, the assets or the body class for one type, point that type to a template of your site package in your own page TSconfig, which loads after the set. To keep Camino's summary for a type, point the type back to Camino's own preview template:
mod.web_layout.tt_content.preview.camino_sociallinks = EXT:theme_camino/Resources/Private/Templates/ContentPreviews/Linklist.fluid.html
Using the pattern in your own project
For a theme other than Camino, take the three pieces of this extension and adjust them in your site package:
- A preview template that hands the record to Look and loads the stylesheet
of your theme (
css, optionallyjsandbody).Class - Page TSconfig that maps your content types to that template via
mod..web_ layout. tt_ content. preview.<CType> - A site set, or your existing one, that ships the TSconfig.
Nothing else is needed; this extension has no PHP. The Look documentation explains the view helper arguments and when to prefer Content Blocks with Fluid Components instead of the TypoScript way.