简体   繁体   English

Typo3:后端布局CSS

[英]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. 我正在开发一个Typo3项目,并成功创建了后端布局,该布局将使用同名的给定Fluid HTML模板。

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. 所以现在我的问题是,我如何还可以将我的页面css(我现在有一个主css排列到所有页面上)与后端布局链接起来。 For example the selecting the contact backen layout will add the contact.css file to the fluid template. 例如,选择contact backen布局会将contact.css文件添加到流体模板中。

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. 我知道可以做到的一种方法是在每个页面的后端创建一个Typo3模板,但是我想那不是实现它的最佳方法。 All of my fluid templates and typoscript are inside an extension created with the great tool sitepackagebuilder . 我所有的流畅模板和打字稿都在用出色的工具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. 取而代之的是,您可以按照更好的开发标准(如@sebkln)为子页面创建新的布局。 said. 说过。

Thank you! 谢谢! Regards. 问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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