TYPO3 v8.5 with Fluidtemplate and fluid-styled-content - Partials not working - typo3

I use TYPO3 v8.5 with fluid-templating (with layout, partials and template) and fluid-styled-content.
However, as soon as I create a fsc-element e.g. text&media on my site, the partial files are ignored and only the section from the template file is output in the FE.
If I set the content-element to "hide", then the correct site-structure with partials were output in the FE.
My root-template is:
page = PAGE
page.includeCSS {
main = fileadmin/Demo/Resources/Public/Css/main.css
}
page.10 = FLUIDTEMPLATE
page.10 {
layoutRootPaths {
10 = fileadmin/Demo/Resources/Private/Layouts
20 = fileadmin/Demo/Individual/Private/Layouts
}
partialRootPaths {
10 = fileadmin/Demo/Resources/Private/Partials
20 = fileadmin/Demo/Individual/Private/Partials
}
templateRootPaths {
10 = fileadmin/Demo/Resources/Private/Templates
20 = fileadmin/Demo/Individual/Private/Templates
}
variables {
contentMain < styles.content.get
}
file.stdWrap.cObject = CASE
file.stdWrap.cObject {
key.data = pagelayout
default = TEXT
default.value = fileadmin/Demo/Resources/Private/Templates/DefaultTemplate.html
pagets__1 < .default
}
}
My page-TSconfig:
mod.web_layout.BackendLayouts {
1 {
title = Default Template
config {
backend_layout {
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = Main Content
colPos = 0
}
}
}
}
}
}
}
}
DefaultLayout.html :
<f:render partial="Header"/>
<f:render section="Main"/>
<f:render partial="Footer"/>
Footer.html :
<div class="footer-container">
<footer class="wrapper">
Hier steht der Footer-Text
</footer>
</div>
Header.html :
<div class="header-container">
<header class="wrapper clearfix">
<h1 class="title">LOGO</h1>
<nav>
Hier erscheint die Navigation
</nav>
</header>
</div>
DefaultTemplate.html :
<f:layout name="DefaultLayout"/>
<f:section name="Main">
<div class="main-container">
<div class="main wrapper clearfix">
<article>
<f:format.raw>{contentMain}</f:format.raw>
</article>
</div>
</div>
</f:section>
Does anyone know this behavior and can give me a tip what's wrong with my code.
In TYPO3 v7.6 this code works fine.

There is currently an open bug (see https://forge.typo3.org/issues/77235) regarding this issue. Try to rename your Partials as a workaround until this is fixed.

Related

TYPO3 - FilesProcessor - print out image tag in FLUID Template

I want to read out the "images" from a content element with FilesProcessor.
But I can't get the files array filled
In the TYPO3-Backend I add an image to the content element:
My TypoScript:
// Part 1: Fluid template section
page.10 = FLUIDTEMPLATE
page.10 {
templateName = TEXT
templateName {
cObject = TEXT
cObject {
data = pagelayout
required = 1
case = ucfirst
split {
token = pagets__
cObjNum = 1
1.current = 1
}
}
ifEmpty = Default
}
templateRootPaths {
0 = EXT:site_package/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:site_package/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:site_package/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
}
page.10 {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
levels = 1
includeSpacer = 1
as = mainnavigation
}
20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
20 {
table = tt_content
orderBy = sorting
where = colPos = 1
as = jumbotronContent
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
as = images
reference.fieldName = image
}
}
}
}
}
My Jumbotron-Content-Element HTML-Template:
<f:debug title="all" inline="true">{_all}</f:debug>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<section class="hero">
<div class="d-flex container">
<div class="d-flex flex-column justify-content-center">
<f:for each="{jumbotronContent}" as="Jumbotron" iteration="iter">
<h1>{Jumbotron.data.header}</h1>
<h2>{Jumbotron.data.subheader}</h2>
<button>SABER MAIS AGORA</button>
</f:for>
</div>
<div class="hero-image d-flex justify-content-center">
<f:for each="{images}" as="image">
<f:debug>{image}</f:debug>
<f:image image="{image.originalFile}"/>
</f:for>
</div>
</div>
</section>
</html>
But the f:debug-Viewhelper tells me
images => array(empty)
How can I fill the image array? I probably put the FilesProcessor code on the wrong place.
Can someone plase assist.
Thank you
Your configuration has a typo: it should be references (plural):references.fieldName
page.10.dataProcessing.20.dataProcessing.10.references.fieldName = image

Typo3 Fluid renders html in the frontend instead of including the html to the homepage

i am trying to use Typo3 Fluid with Backendlayouts. But instead of rendering the Content Elements it renders the Html of the Content elements. For example i have a simple Text-Element in the Backend with "some text". It will show <p>some text</p> in the Frontend not "some text" as expected. The html of the homepage looks like this:
<p>
<p>test</p>
</p>
The viewhelper i used to render the content looks like this:
<div class="col-md-4">
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="{pageUid: '{data.uid}', colPos: '11'}" />
</div>
As you can see there is no <p></p> tag at all in my Default.html.
I know that the Text element itself uses the <p> </p> Tags in the backend but i am surprised they get rendered as text and also included in the html. I just want the html of the Contentelement to be included in the html of the homepage
I guess the mistake could be in this typoscript for the lib.dynamicContent in my custom theme extension:
lib.dynamicContent = COA
lib.dynamicContent {
10 = LOAD_REGISTER
10 {
colPos.cObject = TEXT
colPos.cObject {
field = colPos
ifEmpty.cObject = TEXT
ifEmpty.cObject {
value.current = 1
ifEmpty = 0
}
}
pageUid.cObject = TEXT
pageUid.cObject {
field = pageUid
ifEmpty.data = TSFE:id
}
contentFromPid.cObject = TEXT
contentFromPid.cObject {
data = DB:pages:{register:pageUid}:content_from_pid
data.insertData = 1
}
wrap.cObject = TEXT
wrap.cObject {
field = wrap
}
}
20 = CONTENT
20 {
table = tt_content
select {
includeRecordsWithoutDefaultTranslation = 1
orderBy = sorting
where = {#colPos}={register:colPos}
where.insertData = 1
pidInList.data = register:pageUid
pidInList.override.data = register:contentFromPid
}
stdWrap {
dataWrap = {register:wrap}
required = 1
}
}
30 = RESTORE_REGISTER
}
This is the Default.html
<f:layout name="Default" />
<f:section name="Main">
<main role="main">
<div class="container">
<div class="row">
<div class="col-md-4">
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="pageUid: '{data.uid}', {colPos: '11'}" />
</div>
<div class="col-md-4">
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="pageUid: '{data.uid}', {colPos: '12'}" />
</div>
<div class="col-md-4">
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="pageUid: '{data.uid}', {colPos: '13'}" />
</div>
</div>
</div>
</main>
</f:section>
Thank you for your time and please comment if you need more information to be able to help me.
Daniel
I found the mistake and it was a basic one i guess. I did not include the Fluid Content Elements Css - only the Fluid Content Elements. Thanks for your input. If you have this problem include it in your typoscript or in your root-template in the backend. It should appear in "includes"
Probably missing a <f:format.raw> around your Content fluid will htmlescape by default

TYPO3 FLUID blank page TYPO3

I try to create my first FLUIDTEMPLATE. But the Methode
f:layout
dont get activated.
My structure:
/fileadmin/
/fileadmin/layouts/layout.html
/fileadmin/partials/
/fileadmin/styles/
/fileadmin/templates/template.html
/fileadmin/typoscript/
/fileadmin/typoscript/01_script/setup.ts
/fileadmin/typoscript/02_object/
setup.ts:
page = PAGE
page.typeNum = 0
page.10 = FLUIDTEMPLATE
page.10 {
format = html
file = fileadmin/templates/layouts/layout.html
partialRootPath = fileadmin/templates/partials/
layoutRootPath = fileadmin/templates/layouts/
variables {
content_main < styles.content.get
content_main.select.where = colPos = 0
}
}
page.10.file.stdWrap.cObject = CASE
page.10.file.stdWrap.cObject {
key.data = levelfield:-1, backend_layout_next_level, slide
key.override.field = backend_layout
default = TEXT
default.value = fileadmin/templates/template.html
}
Layout.html:
<div id="wrapper">
<div id="header">
header
</div>
<div id="top_nav">
top_nav
</div>
<div id="left">
left
</div>
<div id="right">
right
</div>
<div id="center">
center
</div>
<div id="footer">
footer
</div>
</div>
template.html:
<f:layout name = "Layout" />
template setup:
<INCLUDE_TYPOSCRIPT: source ="DIR:fileadmin/typoscript/">
Now, if i view the webpage i only see a blank page. If i look on the code i get that:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--
This website is powered by TYPO3 - inspiring people to share!
TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
TYPO3 is copyright 1998-2017 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
Information and contribution at https://typo3.org/
-->
<title>Fluid</title>
<meta name="generator" content="TYPO3 CMS">
<link rel="stylesheet" type="text/css" href="typo3temp/Assets/b9db200ac9.css?1491821607" media="all">
</head>
<body>
<f:layout name = "Layout" />
</body>
</html>
I am using TYPO3 v7.6.16.
Templates: Startseite.html
<f:layout name="Default" />
<f:section name="body">
<div id="wrapper">
<div id="header">
{header->f:format.raw()}
</div>
<div id="top_nav">
{top_nav->f:format.raw()}
</div>
<div id="left">
{left->f:format.raw()}
</div>
<div id="right">
{right->f:format.raw()}
</div>
<div id="center">
{center->f:format.raw()}
</div>
<div id="footer">
{footer->f:format.raw()}
</div>
</div>
</f:section>
you can configure same for inner page(Inhaltsseite) layout.
Layouts: Default.html
<f:render section="body" />
Typoscript: (setup.ts)
lib.pageTemplate = FLUIDTEMPLATE
lib.pageTemplate {
templateName = TEXT
templateName.stdWrap.cObject = CASE
templateName.stdWrap.cObject {
key.field = backend_layout
# #todo: setup all page templates
default = TEXT
default.value = Startseite
1 = TEXT
1.value = Inhaltsseite
}
templateRootPaths {
10 = fileadmin/templates/Resources/Private/Templates/
}
partialRootPaths {
10 = fileadmin/templates/Resources/Private/Partials/
}
layoutRootPaths {
10 = fileadmin/templates/Resources/Private/Layouts/
}
variables {
content = CONTENT
content {
table = tt_content
select.orderBy = sorting
slide = -1
select.where = colPos=0
}
}
}
# Page setup Configuration
page = PAGE
page {
# Your TypeNum
typeNum = 0
#Include header data if any
headerData{
}
#Include website meta
meta{
}
#Include stylesheet
includeCSS {
}
#Include Js files(In the header)
includeJS {
}
#Include Js in footer
includeJSFooter {
}
# assign template (copy fluid template object)
10 < lib.pageTemplate
}
Include setup.ts in the template->include->setup.ts from the BE.
<INCLUDE_TYPOSCRIPT:source="FILE:fileadmin/templates/Configuration/TypoScript/setup.ts" />
Greetings!
There are several issues with your example code. Lets go through them:
You should not put your templates in the fileadmin where they are (by default) accessable by web requests and editable by editors. Instead put them inside an extension under Resources/Private/.
You should not specify the layout file as your template. You have
file = fileadmin/templates/layouts/layout.html
Instead of the layout.html you should point to a template like your Template.html inside Resources/Private/Templates
In your template you then may include a layout file. But remove the whitespaces: <f:layout name="Layout" />.
Use UpperCase names for your template, layout and partial files (Template.html instead of template.html).
Use templateRootPaths and layourRootPaths and partialRootpaths instead.
So your TypoScript could look like this:
page.10 = FLUIDTEMPLATE
page.10 {
format = html
file = EXT:my_ext/Resources/Private/Templates/Template.html
partialRootPaths {
10 = EXT:my_ext/Resources/Private/Partials/
}
layoutRootPaths {
10 = EXT:my_ext/Resources/Private/Layouts/
}
templateRootPaths
10 = EXT:my_ext/Resources/Private/Templates/
}
variables {
content_main < styles.content.get
content_main.select.where = colPos = 0
}
}
you first have to create a page object in typoscript (which is missing in the typoscript above):
page = PAGE
this should be the first line in your typoscript.

TYPO3 - Custom page types not showing in menu

in my TYPO3 7.5 project I have created some custom page types by registering them in ext_tables.php as described further here
I can select those page types in the backend, no errors, all good. Also checking for a certain page-type via statements in the frontend works fine.
Now I want to create a menu of those (sub-)page trees. The TypoScript solution looks like this and works fine:
lib.tourTeasers = HMENU
lib.tourTeasers {
special = directory
wrap = <section class="row">|</section>
1 = TMENU
1 {
wrap = <div class="col-sm-12">|</div>
expAll = 1
NO {
doNotLinkIt = 1
linkWrap = <h2 style="text-align:right">Kategorie: |</h2>
}
}
2 = TMENU
2{
expAll = 1
NO{
doNotLinkIt = 1
linkWrap = <h3>Tourtyp: |</h3>
}
}
3 = TMENU
3{
NO{
doNotLinkIt = 1
linkWrap = <h4>|</h4>
after.cObject = COA
after.cObject {
stdWrap.dataWrap = <div class="row teaser">|</div>
10 = FILES
10 {
references {
table = pages
fieldName = media
}
renderObj=IMAGE
renderObj{
file{
width=300c
height=150c
#maxW=257c
#maxH=150c
import.data= file:current:publicUrl
}
altText.data = file:current:title
#altText.field=abstract
#titleText.field=nav_title
#stdWrap.dataWrap = |</a>
stdWrap.dataWrap(
<a href="index.php?id={field:uid}" title="Tour {field:title} ansehen">
<div class="col-sm-4 teaser__image">|</div>
</a>
)
params = class="img-responsive"
}
}
30 = TEXT
30.field = abstract // bodytext
30.crop = 250
30.wrap = <div class="col-sm-8 teaser__description"><p>|</p>
40 = TEXT
40.value = Ansehen
40.typolink.parameter.field = uid
40.typolink.ATagParams = class="btn"
40.wrap = <div class="button teaser__cta">|</div></div>
}
}
}
}
My problem is:
If I use the very Fluid Viewhelper that is intended to render exacly the same
<v:page.menu.directory pages="{page_uid}" as="tours" expandAll="true">
<f:for each="{tours}" as="tour">
<div class="row">
<div class="col-sm-3">
<v:page.resources.fal table="pages" field="media" uid="{tour.uid}" as="images">
<f:for each="{images}" as="image">
<f:image src="{image.url}" alt="{image.alternative} {image.name}" title="{image.title}" class="img-responsive"/>
</f:for>
</v:page.resources.fal>
</div>
<div class="col-sm-9">
<h3>{tour.title}</h3>
{tour.abstract}
</div>
</div>
</f:for>
</v:page.menu.directory>
{page_uid} being the parent page, nothing is displayed.
If I change some of the sub-pages' doktype back to "default" they are displayed in the rendered menu.
any idea as to why this is? Am i missing a certain argument in the viewhelper? i also tried to set the allowed doktypes in the viewhelper but that doesn't change anything.
thanks for the reponses, indeed it had to do with the doktype, is I didn't include the "new" ones for both the parent pages AND their sub-pages. Works now, solved. Fluid really rocks

TYPO3 v6.1 TemplaVoila - add userFunc to specific template part

how can I replace programmatically via TypoScript the content of {content_left} in a single page via USER_INT with individual PHP content.
<div class="container">
<div class="header span-28">
<f:format.raw>{header}</f:format.raw>
</div>
<img class="logo" src="../fileadmin/logo.png" alt="logo">
<img class="headerimg" src="../fileadmin/header_img.png" alt="headerimg">
<div class="menu span-28">
<f:format.raw>{main_menu}</f:format.raw>
</div>
<div class="service span-28">
<f:format.raw>{service_menu}</f:format.raw>
</div>
<div class="content span-6 append-1">
<f:format.raw>{content_left}</f:format.raw>
</div>
<div class="content span-22 last">
<f:format.raw>{content_right}</f:format.raw>
</div>
<div class="footer span-28 last">
<f:format.raw>{footer}</f:format.raw>
</div>
</div>
My current TypoScript does look like this:
#
temp.info = USER_INT
temp.info {
userFunc = user_various->listContentRecordsOnPage
reverseOrder = 1
debugOutput = 1
}
page.content_left < temp.info
But it does not work. :( No replacement is done.
Thanks for any help.
Cheers
kk3003
gsnerf is absolutety right, it's a FLUIDTEMPLATE element.
Unfortunately this TYPOSCRIPT set to the single page where it should appear does not work, any ideas please?
# Include the PHP file with custom code
includeLibs.user_various = fileadmin/php/example_listRecords.php
#
temp.info = USER_INT
temp.info {
userFunc = user_various->listContentRecordsOnPage
}
page = PAGE
page {
typeNum = 0
metaCharset = utf-8
includeCSS{
file10 = fileadmin/css/blueprint/screen.css
file20 = fileadmin/css/blueprint/print.css
file20.media = print
file100 = fileadmin/css/main.css
file300 = fileadmin/css/service.css
file400 = fileadmin/css/mainMenu.css
file500 = fileadmin/css/sliding-box.css
file600 = fileadmin/css/gridelements.css
}
includeJS {
file10 = fileadmin/js/accordion.js
}
}
[browser = msie]
page.includeCSS.file30 = fileadmin/css/blueprint/ie.css
page.includeCSS.file30.media = screen
[global]
page.meta {
MSSmartTagsPreventParsing = true
imagetoolbar = false
}
# https_enforcer
page.5 < plugin.tx_httpsenforcer_pi1
# Create a Fluid Template
page.10 = FLUIDTEMPLATE
page.10 {
# Set the Template Pathes
file = fileadmin/templates/html/template.html
partialRootPath = fileadmin/templates/html/partials/
layoutRootPath = fileadmin/templates/html/layouts/
variables {
header < lib.header
content_left < lib.contentLeft
content_right < temp.info
main_menu < lib.mainMenu
service_menu < lib.serviceMenu
footer < lib.footer
}
}
Thanks
I'm not sure what this is supposed to have to do with templavoila? This seems more like fluid to me. If that is the case you have to replace your
page.content_left < temp.info
with the following:
10 = FLUIDTEMPLATE
10 {
[...]
variables.content_left < temp.info
}
Assuming you already have a FLUIDTEMPLATE definition you only need to copy the variables line into that one.