3

I upgrade my TYPO3 from 7.6 to 8.6. Now I cant set variables via style.content.get, my root template loads fluid_styled_content. some source:

page.10 = FLUIDTEMPLATE
page.10 {
    partialRootPath ={$resDir}/Private/Partials
    layoutRootPath = {$resDir}/Private/Layouts

   variables {
        contentMain < styles.content.get
        contentMain.select.where = colPos = 0
        contentnew < styles.content.get
        contentnew.select.where = colPos = 1
        contentkat < styles.content.get
        contentkat.select.where = colPos = 2

        test = TEXT
        test.value = loool
    }
}

display the variables:

<f:format.raw> {contentMain} </f:format.raw>
<f:format.raw> {contentnew} </f:format.raw>
<f:format.raw> {contentkat} </f:format.raw>
<f:format.raw> {test} </f:format.raw>
Daniel
  • 6,916
  • 2
  • 36
  • 47
Alex Kau
  • 41
  • 2
  • 3

3 Answers3

2

styles.content.get is defined in ext:fluid_styled_content but very late so most copies are empty. References are no solution as the modification for colPos would apply to all references.

At the moment the best solution seems to be an own definition of styles.content.get early in your TS:

styles.content.get = CONTENT 
styles.content.get {
    table = tt_content
    select {
        orderBy = sorting
        where = colPos=0
    }
}

but as it is an own definition I would rename it to temp.content.get so it is identifiable as my own version (no confusion if the global definition changes)

Bernd Wilke πφ
  • 10,390
  • 1
  • 19
  • 38
2

There is a Bug in TYPO3 8.6: https://forge.typo3.org/issues/80044

Add this before you assign styles.content.get to your variables: <INCLUDE_TYPOSCRIPT: source="FILE:EXT:frontend/ext_typoscript_setup.txt"> Then you can use it just as before.

bandanh
  • 533
  • 4
  • 20
1

SOLVED Thanks to Bernd! Solved this problem. Here a full example:

mystyles.content.get = CONTENT 
mystyles.content.get {
    table = tt_content
    select {
        orderBy = sorting
        where = colPos=0
    }
}


page.10 = FLUIDTEMPLATE
page.10 {
    partialRootPath ={$resDir}/Private/Partials
    layoutRootPath = {$resDir}/Private/Layouts

    variables {
        contentMain < mystyles.content.get
        contentMain.select.where = colPos = 0
        contentnew < mystyles.content.get
        contentnew.select.where = colPos = 1
        contentkat < mystyles.content.get
        contentkat.select.where = colPos = 2

        test = TEXT
        test.value = loool
    }
}
Kau
  • 11
  • 2
  • 1
    if someone help you with the answer, ask him to put the comment in to an answer and accept and/or upvote, recommend to delete your own answer, your decisicion – Gang Mar 04 '17 at 20:38
  • 1
    in my solution I suggested to use `temp.content.get` as all TS-objects that start with `temp.` are removed before rendering execution resulting in a smaller configuration array. especially for prototypes which gets copied there is no need to be known at rendering time. – Bernd Wilke πφ Mar 06 '17 at 09:40