TYPO3 - fluidstyledcontent包装元素

时间:2016-10-05 10:25:47

标签: typo3 typoscript typo3-7.6.x fluid-styled-content

我想在自定义插件的整个输出的包装中添加一个自定义类。 fluid_styled_content生成<div id="c55">标记。在那里,我想添加在插件的flexform中定义的自定义类。

我是否必须覆盖fluid_styled_content包的文件HeaderContentFooter.html,或者是否存在针对该问题的不同解决方案。如果我覆盖该文件,则无法访问插件的flexform值。

我很感谢你的每一个帮助。

干杯

1 个答案:

答案 0 :(得分:0)

将布局复制到您自己的模板文件夹是解决此问题的最佳方法:

我不是shure,为什么你无法访问插件设置。 Creatae是一个tempalte扩展:

复制文件

typo3conf\ext\YOUR_template_EXT\Resources\Private\Fluid\Content\Layouts\HeaderContentFooter.html

将此添加到错字脚本

plugin.tx_yourtemplateext_template {
    view {
        templateRootPaths.0 = EXT:yourtemplateext_template/Resources/Private/Templates/
        partialRootPaths.0 = EXT:yourtemplateext_template/Resources/Private/Partials/
        layoutRootPaths.0 = EXT:yourtemplateext_template/Resources/Private/Layouts/
    }
}

将类似内容添加到HeaderContentFooter.html

{namespace css=DEVKEY\extensionname\ViewHelpers}

并呈现Css类

{css:getclass()}

在中创建一个Viewhelper extensionname \ Classes \ ViewHelpers \ getclass.php

里面有这样的东西:

namespace DEVKEY\extensionname\viewhelper ;

class getclassViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper   {
   public function render() {
        $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
        $configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
        $settings = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT );
      return $settings['FlexFormfieldName'] ;
  }
}

未完全测试但应该这样做

相关问题