0

I want to change the Layout of my Headers in TYPO3. There is a post about this but this but I cant get it to work and that post is 2 years old. With TYPO3 most stuff is outdated quite quickly. This is the post. Additionally I looked at this article. I know it is in German, maybe it helps anyways.


So I copied the Header.html from the TYPO3 system files, put it in a directory under fileadmin and tried to link to that directory.

fileadmin/.../Partials/Header/Header.html

In the Template setup i added the partialRootPath.

page = PAGE
page {

  shortcutIcon = fileadmin/sitedesign/Resources/Private/Templates/Vave/img/Favicon.ico

  10 = FLUIDTEMPLATE
  10.file = fileadmin/sitedesign/Resources/Private/Templates/Vave/Contact/index.html
  10.partialRootPath {
    20 = fileadmin/Resources/Private/Partials
  }

  includeCSS {
    contactFile1 = fileadmin/sitedesign/Resources/Private/Templates/Vave/Contact/css/Contact.css
  }


}

In Header.html I created an additional case to check if it was working.

<f:case value="7">
            <p class="{positionClass}">
                    <f:link.typolink parameter="{link}">{header}</f:link.typolink>
            </p>
</f:case>

I then added that new case in the Page Resources to the TSConfig.

TCEFORM.tt_content.header_layout {
    addItems.7 = Name1 
}

Changing the content of the Header.html file in the TYPO3 system files works the way I expected it to, so I am quite sure that I understand the basic functionality. The TSConfig part works as well, because I can select "Name1" in the Header Layout Type field.

But no matter what part in the fileadmin Header.html version I change, nothing happens. I checked the path to that Partials folder and the spelling of everything a million times, so I do not think that is the issue either.

Of course I could just change the system file Header.html but that seems wrong on a lot of levels.

Thank you for any help.

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

2 Answers2

0

Don't mix different usages of fluid!

You want to change the header partial of your content elements.

But you add the new partial to the fluid of page rendering.

if you use FSC (Fluid Styled Content) your additional partial path should go here:

lib.contentElement {
    partialRootPaths {
        10 = fileadmin/Resources/Private/Partials
    }
}

breaking change: lib.contentElementinstead of lib.fluidContent

Additional advices:

  • be carefull with the names: aside from partialRootPaths there sometimes exist partialRootPath (without s in the end), which is not an object array. That enables you to set only one path (not the usual path list with priority) and which has priority over settings in partialRootPaths if both exist.

  • separate the different fluid usages!
    Give them different paths. There are multiple ways. I prefer:
    each extension gets it's own three folders in a folder named for the extension.
    And also separate the page rendering and CEs (Content Elements). Your own CEs might be considered as part of the extension 'FSC'.

  • use a site extension.
    All configuration goes into that extension: typoscript, templates, viewhelpers, TCA, ...
    That is the basic configuration for that site, but also the additional configuration/ adaption for the used extensions.

Bernd Wilke πφ
  • 10,390
  • 1
  • 19
  • 38
  • Thank you that was very helpful! Great Advice! After some more research I found out that they changed it to lib.contentElement [here](https://stackoverflow.com/questions/44217102/typo3-8-7-can-not-override-fluid-styled-content-templates/44225764#44225764) and [here](https://docs.typo3.org/typo3cms/extensions/fluid_styled_content/8.7/Configuration/OverridingFluidTemplates/). So now it works. Should I put the answer in my Question or should I mark your answer as correct and you add that? Sorry I am new at this. – Bence Brown Apr 10 '19 at 10:41
  • I changed the TS path and added a link to the release note of the breaking change regarding the path – Bernd Wilke πφ Apr 10 '19 at 11:10
-1

May this code will help you!!

page = PAGE
page {
  shortcutIcon = fileadmin/sitedesign/Resources/Private/Templates/Vave/img/Favicon.ico
  10 = FLUIDTEMPLATE
  10 {
    templateName = TEXT
    templateName {
      cObject = TEXT
      cObject {
        data = levelfield:-2,backend_layout_next_level,slide
        override.field = backend_layout
        required = 1
        case = uppercamelcase
        split {
          token = pagets__
          cObjNum = 1
            1.current = 1
        }
      }
      ifEmpty = Innenseite
    }
    #templateName=TEXT
    # templateName.value=index
    layoutRootPaths {
      20 = your layoutRootPaths
    }
    partialRootPaths {
      20 = your partialRootPath
    }
    templateRootPaths {
      20 = your templateRootPath
    }
  }
  includeCSS {
    contactFile1 = fileadmin/sitedesign/Resources/Private/Templates/Vave/Contact/css/Contact.css
  }
}

Make sure header included properly in main template

Bernd Wilke πφ
  • 10,390
  • 1
  • 19
  • 38
gautamsinh mori
  • 314
  • 2
  • 8