InvalidTemplateResourceException after move to new server - typo3

i have a site package extension for my template in Typo3 9.5. Furthermore I have another extension for a specific purpose. Now this extension searches in the ProviderExtension for template files!?!? On my development machine everything works fine. After I have transferred everything to a remote server, this exception occurs on those pages where the plugin of the extension is included. Other pages work.
The Fluid template files enter code here
"/home/.sites/822/site4946398/web/bttemplate/public/typo3conf/ext/amtstafel/Resources/Private/Partials/Navigation/Top.html",
"/home/.sites/822/site4946398/web/bttemplate/public/typo3conf/ext/amtstafel/Resources/Private/Partials/Navigation/Top"
could not be loaded.
Here is the typoscript fom the Site-Template
page = PAGE
page {
config.index_enable = 1
typeNum = 0
shortcutIcon = EXT:btbuerger2/Resources/Public/Icons/favicon.ico
10 = FLUIDTEMPLATE
10 {
templateName = TEXT
templateName {
cObject = TEXT
cObject {
data = pagelayout
required = 1
case = uppercamelcase
split {
token = pagets__
cObjNum = 1
1.current = 1
}
}
ifEmpty = Default
}
templateRootPaths {
0 = EXT:btbuerger2/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:btbuerger2/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:btbuerger2/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
...
The extension amtstafel has a static typoscript which is included in the Main-Template. Here templateRootPaths and layoutRootPaths is defined. As mentioned, the Extension was built with Extension-Builder and works fine so long..
plugin.tx_amtstafel_bulletinentry {
view {
templateRootPaths.0 = EXT:{extension.shortExtensionKey}/Resources/Private/Templates/
templateRootPaths.1 = {$plugin.tx_amtstafel_bulletinentry.view.templateRootPath}
layoutRootPaths.0 = EXT:tx_amtstafel/Resources/Private/Layouts/
layoutRootPaths.1 = {$plugin.tx_amtstafel_bulletinentry.view.layoutRootPath}
}
"bttemplate" is the template extension, "amtstafel" is the additional extension.
In the place of .../amtstafe/... there is not need for partials ...
Thank you for help!
Thomas

I suspect that your constant page.fluidtemplate.partialRootPath is set to EXT:amtstafel/Resources/Private/Partials/
This constant is used in your page.10.templateRootPaths.1

Related

TYPO3 How to overwrite blog extension in custom extension

I tried this, in my extension's setup.typoscript. but is not work for me.
plugin.tx_blog {
view {
layoutRootPaths = EXT:solution/Resources/Private/Extensions/Blog/Layouts/
partialRootPaths = EXT:solution/Resources/Private/Extensions/Blog/Partials/
templateRootPaths = EXT:solution/Resources/Private/Extensions/Blog/Templates/
}
}
all the "RootPaths" are arrays so change it to somting like this
plugin.tx_blog {
view {
layoutRootPaths.200 = EXT:solution/Resources/Private/Extensions/Blog/Layouts/
partialRootPaths.200 = EXT:solution/Resources/Private/Extensions/Blog/Partials/
templateRootPaths.200 = EXT:solution/Resources/Private/Extensions/Blog/Templates/
}
the "200" in the examle is the position if Fluid is looking for a Resource (like a template) it will check every provided path in numerical order.
use the Typoscript Object Browser (in the Template Module) to check the configured RootPaths
The standard setup of that extension is a bit uncommon.
The easiest was to override the paths for fluid files is to use the constant editor. There you have fields where you can enter your own paths.
If you want to do it in the setup, you can look in the TypoScript setup of the extension that looks like shown below.
page = PAGE
page {
typeNum = 0
10 = FLUIDTEMPLATE
10 {
templateName = BlogList
templateRootPaths {
0 = EXT:blog/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:blog/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:blog/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
...
So in a short block the the paths would look like this:
page.10.templateRootPaths {
0 = EXT:blog/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
page.10.partialRootPaths {
0 = EXT:blog/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
page.10.layoutRootPaths {
0 = EXT:blog/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
In the lines starting with 1 you can enter your own path if you never want to use the constants. For this you never have to enter it in the original TypoScript template, but just copy the block above in your own TypoScript and adjust the paths. If your TypoScript is loaded after that of the blog, it's overwriting the original values.
Take care that there exist different setups, one in each folder inside https://github.com/TYPO3GmbH/blog/tree/master/Configuration/TypoScript. So depending on the template you chose the setup must be different. But I hope you're able to adapt the way to go now.

TYPO3 MenuProcessor with dynamic uid

I want to use the MenuProcessor dynamic in my fluidtemplate.
Configured in TypoScript, I want to call it with the cObject ViewHelper and pass the uid of a page to it:
{f:cObject(typoscriptObjectPath: 'lib.menuTest', data:{menuId:'28'})}
This is what I have tried - it should be a special = directory with the the given uid in special.value = XXXXXX.
lib {
menuTest = FLUIDTEMPLATE
menuTest {
templateName = MenuTest
templateRootPaths {
10 = EXT:hatemplate/Resources/Private/Templates/
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
special = directory
special.value = XXXXXX
levels = 1
as = menuItems
}
}
}
}
If I set a uid directly it works, but I don't know how to insert the variable. Has anyone a hint or a working solution?
Thank you
I have solved it with the help of a friend who is much more experienced in TypoScript.
I wasn't as wrong as I thought.
This is the Code in TypoScript. I added the tamplate,layout and partial paths for future copy/pasting :) :
lib {
menuDirectory = FLUIDTEMPLATE
menuDirectory {
templateName = MenuDirectory
layoutRootPaths {
10 = EXT:hatemplate/Resources/Private/Layouts/
}
templateRootPaths {
10 = EXT:hatemplate/Resources/Private/Templates/
}
partialRootPaths {
10 = EXT:hatemplate/Resources/Private/Partials/
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
special = directory
special.value.field = menuId
levels = 1
as = directory
}
}
}
}
With this configured you can use the f:cObject ViewHelper like this:
<f:cObject typoscriptObjectPath="lib.menuDirectory" data="{menuId:1}" />
Or inline
{f:cObject(typoscriptObjectPath: 'lib.menuDirectory', data:{menuId:1})}
This renders the Items into the fluidtemplate:

How to get my other TYPO3 FE templates?

Although it seems so simple I only get one template in my FE. While the BE-layouts are working fine, I do not get any of my other FE-templates. Only the DefaultTemplate is popping up every time. After trying all kind of samples/ topics read, etc, I’m stuck on this. Here is my set-up.
The TSconfig and PageTS all other files are stored in the extension.
# Layout Select box for the FE templates
TCEFORM.pages {
layout.altLabels.3 = NewsLetterTemplate
layout.altLabels.2 = RedFooterTemplate
layout.altLabels.1 = DefaultTemplate
layout.altLabels.0 = DefaultTemplate
removeItems = 4,5,6,7,9,10
}
###########################################
# Config Fluid Template
page = PAGE
page.typeNum = 0
page.10 = FLUIDTEMPLATE
page.10{
#Path to the template files stored extension
partialRootPath = {$resDir}/Private/Partials
layoutRootPath = {$resDir}/Private/Layouts
file = {$resDir}/Private/Templates/DefaultTemplate.html
templateName = TEXT
templateName.stdWrap.cObject = CASE
templateName.stdWrap.cObject {
key.data = pagelayout
default = TEXT
default.value = {$resDir}/Private/Templates/DefaultTemplate.html
#Default template
pagets__DefaultTemplate = TEXT
pagets__DefaultTemplate.value = {$resDir}/Private/Templates/DefaultTemplate.html
#Second template
pagets__RedFooterTemplate = TEXT
pagets__RedFooterTemplate.value = {$resDir}/Private/Templates/RedFooterTemplate.html
#Third template
pagets__NewsLetterTemplate = TEXT
pagets__NewsLetterTemplate.value = {$resDir}/Private/Templates/NewsLetterTemplate.html
}
#Here some variables for use in the template by using {}
variables {
siteName = TEXT
siteName.value = PIZZAWORKSHOP.nl
pageTitle = TEXT
pageTitle.data = page:title
#get the content into the template:
content < styles.content.get
#Maincontent
content_main < styles.content.get
content_main.select.where = colPos = 0
#Content Colom 1
content_column_1 < styles.content.get
content_column_1.select.where = colPos = 1
#Content Colom 2
content_column_2 < styles.content.get
content_column_2.select.where = colPos = 2
}
}
https://pastebin.com/9TLytchv
Maybe one of you can point me into the right direction here? Thanks.
W.
You can add this typoscript Page TSConfig on resource tabe in page properties. For this typoscript you can rename defult frontend layout name.
TCEFORM.pages {
layout.altLabels.3 = NewsLetterTemplate
layout.altLabels.2 = RedFooterTemplate
layout.altLabels.1 = DefaultTemplate
layout.altLabels.0 = DefaultTemplate
}
For use different frontend layout like this.
[globalVar=TSFE:page|layout=3]
page.10.template.file = fileadmin/template/shinynewtemplate.html
page.includeCSS.screen = fileadmin/template/css/style.css
page.includeCSS.screen.media = screen
[global]

Fluid Template doesn't load

I'm building a site with Fluid Template. I have created two different front-end layouts and two different back-end layout but I always get this error #1288085266: No template has been specified. Use either setTemplateSource() or setTemplatePathAndFilename(). Accordingly to Typo3 Wiki this should be a solution Exception/CMS/1288085266
but not in my case. This is my code:
config.doctype = html5
page = PAGE
page {
includeCSSLibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css
includeCSS.style = fileadmin/templates/rka2015/css/style.css
includeJSlibs.jquery = https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
includeJSlibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js
includeJS.custom = fileadmin/templates/rka2015/js/custom.js
}
page.10 = FLUIDTEMPLATE
page.10 {
file = fileadmin/templates/rka2015/layouts/main_layout.html
layoutRootPath = fileadmin/templates/rka2015/layouts/
patialRootPath = fileadmin/templates/rka2015/partials/
variables {
siteName = TEXT
siteName.value = rka2015
contentMain < styles.content.get
contentMain.select.where = colPos = 0
content_column_1 < styles.content.get
content_column_1.select.where = colPos = 1
content_column_2 < styles.content.get
content_column_2.select.where = colPos = 2
}
}
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/rka2015/main_1_column.html
1 = TEXT
1.value = fileadmin/templates/rka2015/main_1_column.html
2 = TEXT
2.value = fileadmin/templates/rka2015/main_2_column.html
}
I have already checked all; section name is OK, ID for back-end layouts are ok, template is defined, everything seem to be as it should be. I really don't have a clue where else to search.
UPDATE!!!
Seems like there is a problem with a file path. I am running my site on a subdomain and it looks like that ts doesn't find the file paths if they are defined only as fileadmin/... Any thoughts? Thanks
SOLUTION!
page {
includeCSSLibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css
includeCSS.style = fileadmin/templates/rka2015/css/style.css
includeJSlibs.jquery = https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
includeJSlibs.jquery.external = 1
includeJSlibs.bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js
includeJS.custom = fileadmin/templates/rka2015/js/custom.js
}
page.10 = FLUIDTEMPLATE
page.10 {
template = CASE
template {
key.data = levelfield:-1,backend_layout_next_level,slide
key.override.field = backend_layout
1 = FILE
1.file = fileadmin/templates/rka2015/main_1_column.html
2 = FILE
2.file = fileadmin/templates/rka2015/main_2_column.html
}
partialRootPath = fileadmin/templates/rka2015/partials/
layoutRootPath = fileadmin/templates/rka2015/layouts/
variables {
siteName = TEXT
siteName.value = rka2015
contentMain < styles.content.get
contentMain.select.where = colPos = 0
content_column_1 < styles.content.get
content_column_1.select.where = colPos = 1
content_column_2 < styles.content.get
content_column_2.select.where = colPos = 2
}
}
First, check out if TYPO3 can read the file by overwriting the page object by appending this to the end of your template:
page.10 >
page.10 = FILE
page.10.file = fileadmin/templates/rka2015/layouts/main_layout.html
If that doesn't generate a page with the raw, uninterpreted output of your template file, then theres something wrong with either the file path or file permissions.
Secondly, in Fluid, Templates and Layouts are different things with different uses and should propably not be put into the same directory.
Most importantly, theres something wrong with the backend layout switch you're trying to build with the CASE in page.10.file.stdWrap.cObject . You see, the stdWrap object actually wraps around the text you've already set. If stdWrap cant find a pipe to figure out how to wrap, it just appends instead. Remove the line where you set the file in the top part and only leave the stdWrap case and you should be good to go.
at the first look it looks right... but check your file paths, maybe they are wrong as "Jost" commented.
i'm not sure but i think the problem is that the template path (file = ...) is the same as layout root path...
by the way... if you include external styles and javascripts you need to set something like the follows i think...
includeJSlibs.jquery = https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
includeJSlibs.jquery.external = 1

fallback for FILES in typoscript

I'm using typoscript go get the first file out of a page. This works and is out of the documentation. But the documentation doesn't tell something about a fallback if no files are found.
lib.files = FILES
lib.files {
references {
table = pages
fieldName = media
}
file =
begin = 0
maxItems = 1
renderObj = TEXT
renderObj {
value = URL: {file:current:publicUrl}
insertData = 1
}
}
A naive .if.isNull failed at the first attpent. Is there a possibilty to define a fallback if the FILES-Object is empty?
Mh,
try to make a second object and check there if lib.files is filled with data.
__
UNTESTED
lib.files = FILES
lib.files {
references {
table = pages
fieldName = media
}
file =
begin = 0
maxItems = 1
renderObj = TEXT
renderObj {
value = URL: {file:current:publicUrl}
insertData = 1
}
}
lib.fileFallback = COA
lib.fileFallback {
10 < lib.files
20 = TEXT
20 {
value = Do something
stdWrap.if.isFalse.cObject < lib.fileFallback.10
}
}
I am using this technique often to slide through pages for slideshow objects.
Let me know, if it is working.
You should check the TypoScript Reference stdWrap.ifEmpty.
In your case the code should look like this
lib.files {
# ....
stdWrap.ifEmpty.cObject = IMAGE
stdWrap.ifEmpty.cObject{
file = fileadmin/.../my_image.png
}
# ....
}
You can use every cObject you want.
Check out Content Objects (cObject)