Skip to content

Instantly share code, notes, and snippets.

@andypa
Created June 27, 2019 08:21
Show Gist options
  • Save andypa/fb983aa81121fc3e739d1fa2c55652f2 to your computer and use it in GitHub Desktop.
Save andypa/fb983aa81121fc3e739d1fa2c55652f2 to your computer and use it in GitHub Desktop.
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
f:schemaLocation="http://fluidtypo3.org/schemas/fluid-master.xsd"
>
<f:layout name="Content">
<f:section name="Configuration">
<content:input name="foo" />
<content:page.includeJS name="myJs" async="1" disableCompression="1" file="EXT:bar/Resources/Public/Javascript/myjs.js" /> <!-- the same options as https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Setup/Page/#includejs-array
</f:section>
<f:section name="Markup">
<h1>{foo}</h1>
</f:section>
</div>
<!--
The section names are just examples, maybe use "Main" instead of "Markup" since that is more wildly used.
How the JS should be included, I'm not really sure, here is what I could imagine:
Way 1 - While saving:
1. Add a "typoscript" column to tt_content
2. During saving, check if some content:page.includeJS exists, generate the typoscript and save it in the "typoscript" column.
This would also count for all other page.include* functions
Way 2 - While rendering:
1. During rendering, check if a content element exists which has <content:page.include*>
2. Convert <content:page.include*> to typoscript and "append" it to the Typoscript of that page.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment