0

I need to get the value of the field backend_layout in my fluid content element.

Via <f:debug /> I get the value in my page template, but not at the level of the content element.

user158
  • 12,852
  • 7
  • 62
  • 94

2 Answers2

2

try to set the following in setup typoscript for "page":

page {

    # e.g. inside your page template "10"
    10 = FLUIDTEMPLATE
    10 {
        # ...

        variables {

            # access this with {layout} in your fluid templates
            layout = TEXT
            layout {
                data = levelfield:-2,backend_layout_next_level,slide
                override {
                    field = backend_layout
                }
            }
        }
    }
}

HerrZ
  • 111
  • 9
  • Thank you, great success – Manuel Bloch Oct 22 '19 at 14:28
  • Note that `{layout}` mentioned above always prepends `pagets__` to the backend layout name. I used `{layout}` like this in a fluid if statement... `Do something`. This returns true if you're not on page with `uid` equal to `1` and you are on a page that is using the backend layout of `sidebar`. – god_is_love Aug 09 '22 at 03:44
0

The easiest way is to use the vhs extension and the view helper v:page.info available there or pass the variable somehow (TypoScript, register, etc.) down to your content elements.

Saeed
  • 3,294
  • 5
  • 35
  • 52
Wolfgang
  • 593
  • 3
  • 8