can someone help me adding a lib to the main section of the page via typoscript
TS:
[globalVar = TSFE:id = 314]
includeLibs.voucher = fileadmin/php/shop_init.php
lib.phpscript = USER
lib.phpscript.userFunc = voucher->init
[global]
Template:
<div class="main-section">
<f:render section="Main" />
<f:cObject typoscriptObjectPath="lib.phpscript" />
</div>
Now the content is showing after the Main section but i need it in the main section :/
What is the ts code for this??
THX in advance!
You have to add
<f:cObject typoscriptObjectPath="lib.phpscript" />
in a template between the tags
<f:section name="main"></f:section>
You can find the templates in the folder:
your_extension\Resources\Private\Templates\
Related
Hi guys so I am trying to create an extension that takes a json file and displays images, so far so good but I would like to paginate through the 500+ images, this is where it goes bad.
I am trying to use the widget.paginate in fluid, the images are displayed but when I click on the 'next' link I get a url that does not work http://localhost/work/index.php?id=7&tx_llgcinfinitescroll_message%5B%40widget_0%5D%5BcurrentPage%5D=2
I get a typo3 error - #1518472189 TYPO3\CMS\Core\Error\Http\PageNotFoundException
<f:widget.paginate objects="{imageData}" as="paginatedImages"
configuration="{itemsPerPage: 24, insertAbove: 1, insertBelow: 0}">
<f:for each="{paginatedImages}" as="image" key="i">
<!-- Assigning Variables -->
<f:variable name="thumbnail" value="{image.imageData.thumbnail}"/>
<f:variable name="fullSizeImage" value="{image.imageData.fullSizeImage}"/>
<f:variable name="imageHeight" value="{image.imageData.imageHeight}"/>
<f:variable name="label" value="{image.imageData.label}"/>
<f:variable name="welshLabel" value="{image.imageData.welshLabel}"/>
<f:variable name="description" value="{image.imageData.description}"/>
<f:variable name="welshDescription" value="{image.imageData.welshDescription}"/>
<!-- Displaying Images -->
<div class="grid__item">
<div class="hovereffect">
<a href="{fullSizeImage}">
<img src="{thumbnail}" itemprop="thumbnail" alt="{label}">
</a>
</div>
</div>
<f:debug>{_all}</f:debug>
</f:for>
</f:widget.paginate>
If someone has any idea what I'm doing wrong please let me know, thanks in advance
Have you simplified the 'next' link in your post? If not, it's missing a cHash. Combined with [FE][pageNotFoundOnCHashError] =true (default), this will end in a 404.
I started using TYPO3 8.7.1 some days ago - no prior experiences in TYPO3.
I am at the point that I am using the t3editor to create a first test template using the guide that's been offered on the official page, which is for version 7. Are there huge differences in templating between those two versions, because I am only getting a blank page and even my source code shows nothing in between the body tags.
# Default PAGE object:
page = PAGE
# Define that we use a Template and where it is located
page.10 = TEMPLATE
page.10 {
template = FILE
template.file = fileadmin/tmp/home.html
}
# Insert shortcut icon in the head of the website
page.shortcutIcon = fileadmin/img/favicon.ico
# Insert stylesheet in the head of the website
page.includeCSS.base = fileadmin/css/style.css
On that note I have another question. I can't seem to find regularity for the highlighting colors used by the t3editor, but at the same time I can't find any errors in this snippet.
Can anyone help?
Best regards
An example with FLUIDTEMPLATE:
In TypoScript Setup:
page = PAGE
page {
10 = FLUIDTEMPLATE
10 {
template = FILE
template.file = fileadmin/Templates/Html/Page/Templates/Default.html
layoutRootPath = fileadmin/Templates/Html/Page/Layouts/
variables {
content < styles.content.get
}
}
}
fileadmin/Templates/Html/Page/Layouts/Default.html
<f:render section="Main" />
fileadmin/Templates/Html/Page/Templates/Default.html
<html>
<head>
<title>Page Template Default</title>
</head>
<body>
<f:layout name="Default"/>
<f:section name="Main">
<f:format.raw>{content}</f:format.raw>
</f:section>
</body>
Then insert content and show the page.
Situation
sysext:filemetadata is activated; images (fal references) are deposited within page resources (pages.media).
2 options are currently known to me in conjunction to TYPO3 pages:
Using a custom FAL viewhelper
Using TypoScript (which is often illegible and not easy to maintain)
Question
What's actually (TYPO3 7.x and 8.x) a common/core-only solution to render such images within fluid with additional properties (metadata) like creator, copyright and so on?
I would go for next approach:
typoscript
page.10 = FLUIDTEMPLATE
page.10 {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = media
}
}
...
}
fluid
<f:for each="{files}" as="file">
<div class="media">
<figure>
<f:media file="{file}" />
<figcaption>
{file.description}<br />
author: {file.properties.creator}<br />
copyright: {file.properties.copyright}
</figcaption>
</figure>
</div>
</f:for>
...
To find all possible sys_file_reference and sys_file_metadata properties just add <f:debug>{file.properties}</f:debug> inside the <f:for ...</f:for>.
I'm using Typo3 7.6.4 and I want to wrap an extension output with a div.
The extension is csv-table.
How can I do this with Typoscript?
Most plug-ins are defined as a USER or USER_INT objects. These have a property stdWrap See TypoScript Reference - USER(_INT)
I couldn't find the extension 'csv-table' for TYPO3 7, but let's assume that it's available in TypoScript as plugin.tx_csvtable_pi1 then you could use something like:
plugin.tx_csvtable_pi1.stdWrap.wrap = <div class="myCsvTable">|</div>
The best way is to use a fluid layout if you use EXT:fluid_styled_content
Resources/Private/Templates/CsvTable.html
<f:layout name="Default" />
<f:section name="Main">
my output
</f:section>
Resources/Private/Layouts/Default.html
<div class="my-element">
<f:render section="Main" />
</div>
TypoScript reference: FLUIDTEMPLATE
If you use the old css_styled_content you can use this
tt_content.my_ext = COA
tt_content.my_ext.stdWrap.wrap = <div>|</div>
I have a simple menu generated by the Fluid Menu ViewHelper:
<v:page.menu useShortcutData="TRUE" levels="3" expandAll="1" class="menu" classActive="act" substElementUid="1" excludePages="12,13,3" />
There are multiple languages and each language has different pages hidden in the navigation that I would like to change in the "excludePages" part.
In Typoscript I would simply use a constants marker like {$exclude}. Adding the marker in fluid breaks the menu. What would be the way to achieve this in an inline Fluid setup like this?
There are different ways to get constant into Fluid.
1. Include form TypoScript
{f:cObject(typoscriptObjectPath: 'lib.myConstant')}
2. Save in settings from your ext.
plugin.tx_myext.settings {
myonstant = TEXT
myconstant = 1,2,3
}
3. Configuration in Page Template (the pure fluid way)
<f:section name="Configuration">
<flux:form id="mypage" options="{icon: 'Icons/Page/Standard.gif'}">
<flux:field.tree name="myConstantFromTRee" table="pages" parentField="pid" expandAll="0" multiple="1" minItems="0" maxItems="0" label="myConstantFromList" foreignLabel="title" size="10"/>
</flux:form>
<flux:grid>
<flux:grid.row>
<flux:grid.column colPos="0" name="main" />
</flux:grid.row>
</flux:grid>
</f:section>
And access it with {settings.myConstantFromTRee}.