假設您使用TYPO 6.x +和Extbase!
您可以將視圖中的其他元素添加到佈局中,方法是額外的節。最有可能你的觀點現在看起來像:
<f:layout name="Default"/>
<f:section name="content">
<h1>Foo</h1>
</f:section>
所以添加新的部分,即:
<f:layout name="Default"/>
<f:section name="myButtons">
<f:be.buttons.icon icon="actions-document-new" title="Create new Foo" />
</f:section>
<f:section name="content">
<h1>Foo</h1>
</f:section>
最後,在你的default.html中佈局使你在適當的地方部分(將其設置爲可選,否則你會丟失,如果得到一個異常!)
....
<div class="typo3-docheader-buttons">
<div class="left">
<f:render section="myButtons" optional="true"/>
</div>
<div class="right">
<a href="javascript:location.reload(true);"><span title="Reload" class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-refresh"> </span></a>
<f:be.buttons.shortcut />
</div>
</div>
....
當然這種方式,您還可以設置其他元素,如<f:be.menus.actionMenu>
,<f:be.pageInfo />
等,甚至只是你的文字標籤。
檢查ViewHelpers在typo3/sysext/fluid/Classes/ViewHelpers/Be/
爲一些準備使用的元素。
感謝您的答案,但我沒有一個default.html或任何HTML只是一個index.php我包括其他PHP文件(我必須努力工作現有的擴展爲我的工作)錯字3 v4.5.x – Wikunia 2015-04-06 12:33:50
編輯你的問題然後添加這些信息(關於版本),這很重要,因爲現在幾乎沒有人使用舊派PI方式。也儘量切換到TYPO3 6.x +儘快 - 特別是如果你打算在未來擴展你的擴展!使用Extbase對FE插件和BE模塊來說絕對是更好的方法。無論如何,您也可以在TYPO 4.5+中創建Extbase擴展,這樣可以更好地遵循最新的穩定TYPO3。不幸的是,我現在無法幫助你,因爲我不記得我上次在哪裏使用PI作爲BE ...這是肯定的很多年前。 – biesior 2015-04-06 12:45:58