简体   繁体   中英

Typo3: Backend Layout CSS

I'm working on a Typo3 Project, with what i have sucessfully created backend layouts, which will use the given Fluid HTML template with the same name.

Here is one of my layouts:

#
# BACKENDLAYOUT: CONTACT
#
mod {
    web_layout {
        BackendLayouts {
            contact {
                title = Contact Layout
                config {
                    backend_layout {
                        colCount = 2
                        rowCount = 1
                        rows {
                            1 {
                                columns {
                                    1 {
                                        name = First Col
                                        colPos = 0
                                    }
                                    2 {
                                        name = Second Col
                                        colPos = 1
                                    }
                                }
                            }
                        }
                    }
                }
                icon = EXT:extensionname/Resources/Public/Images/BackendLayouts/contact.png
            }
        }
    }
}

So now my questions is, how can I also link my page css (I have a main css lined to all pages right now) with the backend layout. For example the selecting the contact backen layout will add the contact.css file to the fluid template.

One way that I know I could do it, would be creating a Typo3 Template in the backend for each page, but I guess that wouldn't be the best way to achieve it. All of my fluid templates and typoscript are inside an extension created with the great tool sitepackagebuilder .

Thanks in advance.

You can manage with typoscript condition, User below condition this will work for you.

[globalVar = TSFE:page|backend_layout = 1]
    page.includeCSS.css = your/file/path.css
[global]
[globalVar = TSFE:page|backend_layout = 2]
    page.includeCSS.css = your/file/path.css
[global]

instead of this, you can create a new layout for the subpage as per better development standards as @sebkln. said.

Thank you! Regards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM