Bug #75862

fluid_styled_content: fallback for template paths doesn't work

Added by Wolfgang Wagner over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2016-04-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

When I want to use own templates for fluid_styled_content, I add a template path with TS:

lib.fluidContent.templateRootPaths.100 = path/to/my/Templates/

This works in TYPO3 7, but not in TYPO3 8.0.1 or 8.1.0-dev
In 8, my own templates are ignored.
Is this a bug or has something changed in 8?


Related issues

Related to TYPO3 Core - Bug #76476: Fluid templateRootPaths can not be overriden once setClosed2016-06-07

Actions
Related to TYPO3 Core - Bug #77631: templateRootPaths-Handling in TYPO3 8Closed2016-08-25

Actions
Related to TYPO3 Core - Bug #79061: Bug in extbase with TemplatesRootPaths in backendClosed2016-12-21

Actions
#1

Updated by Philip Majewski over 4 years ago

Wolfgang Wagner wrote:

When I want to use own templates for fluid_styled_content, I add a template path with TS:

[...]

This works in TYPO3 7, but not in TYPO3 8.0.1 or 8.1.0-dev
In 8, my own templates are ignored.
Is this a bug or has something changed in 8?

Had the same problem with an 8.1 installation. Set lib.fluidContent.partialRootPaths.200 to my custom partial files which weren't rendered at all.

I tried to overwrite the Header.html partial from fluid_styled_content but it wasn't included. When I changed the partial include in the original fluid_styled_content Template for Textmedia like so:

<f:render partial="Header2" arguments="{_all}" />

Where Header2.html was in my custom partialRootPaths it was rendered. So I think it is not possible to override extisting partials/templates.

#2

Updated by Daniel Goerz over 4 years ago

  • Category set to Fluid
  • Priority changed from Should have to Must have
#3

Updated by Stefan Froemken over 4 years ago

  • Status changed from New to Accepted

In resolveTemplateFileForControllerAndActionAndFormat() there is no sorting of the array keys. so it takes the first valid template with array key 0 which is the default one.

foreach ($this->getTemplateRootPaths() as $templateRootPath) {
    $candidate = $this->ensureAbsolutePath($templateRootPath . $action . '.' . $format);
    if (file_exists($candidate)) {
        return self::$resolvedFiles['templates'][$identifier] = $candidate;
    }
}

What about patching the getters with krsort?

public function getTemplateRootPaths() {
  krsort($this->templateRootPaths);
  return $this->templateRootPaths;
}

Stefan

#4

Updated by Stefan Froemken over 4 years ago

Currently Github throws a massive of 500 and 404 errors.

This is the related pull-request: https://github.com/TYPO3Fluid/Fluid/pull/104

#5

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#6

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#7

Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#8

Updated by Gerrit Code Review over 4 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#9

Updated by Gerrit Code Review over 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#10

Updated by Gerrit Code Review over 4 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#11

Updated by Daniel Goerz over 4 years ago

  • Target version set to 8.2
  • Sprint Focus set to Stabilization Sprint
#12

Updated by Benni Mack over 4 years ago

  • Target version changed from 8.2 to 8.3
#13

Updated by Gerrit Code Review over 4 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#14

Updated by Gerrit Code Review over 4 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#15

Updated by Gerrit Code Review over 4 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#16

Updated by Gerrit Code Review over 4 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#17

Updated by Gerrit Code Review over 4 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#18

Updated by Gerrit Code Review over 4 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#19

Updated by Matthias Toscanelli over 4 years ago

For those who need to make this works before the patch, simply redefine the paths like this:

lib.fluidContent{
    templateRootPaths >
    templateRootPaths {
        100 = path/to/my/Templates/
        10 = {$styles.templates.templateRootPath}
        0 = EXT:fluid_styled_content/Resources/Private/Templates/
    }
    partialRootPaths >
    partialRootPaths {
        100 = path/to/my/Partials/
        10 = {$styles.templates.partialRootPath}
        0 = EXT:fluid_styled_content/Resources/Private/Partials/
    }
    layoutRootPaths >
    layoutRootPaths {
        100 = path/to/my/Layouts/
        10 = {$styles.templates.layoutRootPath}
        0 = EXT:fluid_styled_content/Resources/Private/Layouts/
    }
}

#20

Updated by Sergio Catalá over 4 years ago

Is there another workaround for FLUIDTEMPLATE objects?
I tried the previous code inside a FLUIDTEMPLATE page.10 object without success
I am not able to render any partials.

#21

Updated by Benni Mack about 4 years ago

  • Target version changed from 8.3 to 8.4
#22

Updated by Gerrit Code Review about 4 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#23

Updated by Gerrit Code Review about 4 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#24

Updated by Gerrit Code Review about 4 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#25

Updated by Gerrit Code Review about 4 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#26

Updated by Gerrit Code Review about 4 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#27

Updated by Gerrit Code Review about 4 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#28

Updated by Gerrit Code Review about 4 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48279

#29

Updated by Helmut Hummel about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#30

Updated by Riccardo De Contardi about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF