TYPO3 流体 xml 渲染

TYPO3 fluid xml rendering

我想将 TYPO3 fe 插件渲染为有效 xml

我该如何更改:(我的布局)

<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
         xmlns:f="http://xsd.helhum.io/ns/typo3/cms-fluid/6.2/ViewHelpers">

    <f:layout name="Rss"/>
    <f:section name="main">

        <f:for each="{events}" as="event" iteration="iteratorEvents">

        <item>
            <topic>{event.topic}</topic>
            <startTime>StartDatum: <f:format.date format="{dateFormat}">{event.startDateTime}</f:format.date></startTime>
            <endTime><f:format.date format="{dateFormat}">{event.endDateTime}</f:format.date></endTime>
        </item>

        </f:for>
    </f:section>

</div>

fe插件页面的错别字是这样的:

page = PAGE
page.20 = TEMPLATE
page.20.template = FILE
page.20.template.file = fileadmin/config/script/template/templateBlank.html
page.20.marks {
  CONTENTMAIN < styles.content.get
  #CONTENTMAIN < tt_content
}

page.config.disableAllHeaderCode = 1
#page.config.xhtml_cleaning = none
#page.config.admPanel = 0
#page.config.metaCharset = utf-8
#page.config.additionalHeaders = Content-Type:text/xml;charset=utf-8

但是我得到了一个白页

我的失败是什么?

更新 新打字稿

    page = PAGE
    page {
      typeNum = 0
      config {
        disableAllHeaderCode = 1
        xhtml_cleaning = none
        admPanel = 0
        debug = 0
        metaCharset = utf-8
        additionalHeaders = Content-Type:text/xml;charset=utf-8
        disablePrefixComment = 1
      }
      10 = USER
      10 {
        userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
        extensionName = institutsseminarverwaltung
        pluginName = ShowseminarsRSS
        vendorName = VENDOR
        switchableControllerActions {
          Event { // Controllername without "Controller"
            1 = rss
          }
        }
      }
    }


Update Localconf

<?php
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'TYPO3.' . $_EXTKEY,
    'Showseminars',
    array(
        'Event' => 'list, download',

    ),

    // non-cacheable actions
    array(
        'Event' => 'list, download',
    )
);



\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'TYPO3.' . $_EXTKEY,
    'ShowseminarsRSS',
    array(
        'Event' => 'rss',

    ),

    // non-cacheable actions
    array(
        'Event' => 'rss',
    )
);

首先,您应该使用如下配置将整个页面(-object)更改为 xml 内容:

page = PAGE
page {
  typeNum = 0
  config {
    disableAllHeaderCode = 1
    xhtml_cleaning = none
    admPanel = 0
    debug = 0
    metaCharset = utf-8
    additionalHeaders = Content-Type:text/xml;charset=utf-8
    disablePrefixComment = 1
  }
  10 = USER
  10 {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = YourExtensionname
    pluginName = PluginName // like "Pi1"
    vendorName = VENDOR // Change to your VendorName
    switchableControllerActions {
      Event { // Controllername without "Controller"
        1 = list // Actionname without "Action"
      }
    }
  }
}

以上配置已经将您的扩展/插件添加到此页面,无需在后端页面模块中添加它,因此您不需要 < styles.content.get

然后您应该将整个模板文件更改为 .xml - 要使其正常工作,您需要像这样(在控制器内部)更改 initializeWhateverAction 中的格式:

public function initializeListAction()
    {
        $this->request->setFormat('xml');
    }

您可能需要清除 Installtool 中的所有缓存。