Insert plugin into a fluid template?

女生的网名这么多〃 提交于 2019-12-11 07:04:20

问题


The extension ke_search has a search field plugin that I want to insert into my fluidtemplate and show on every page. I am very new in this and don't know how to start. Any help is appreciated.


回答1:


You can assign the Plugin to an typoscript lib:

lib.searchMask < tt_content.list.20.your_plugin

(Please search the location of the plugin in the typoscript browser)

In your fluid you can use f:cObjectto include it:

<f:cObject typoscriptObjectPath="lib.searchMask" />



回答2:


In general you have three possibilities to include special content in all your pages:

  1. put the HTML hardcoded in your template (typoscript, marker, fluid)
  2. use a typoscript object which can be inserted in your template
  3. use typoscript to render a special CE on a special page
  4. use a special column in your (BE) page layout, where the content is inherited to subpages

Solution 1 has the drawback of being very static and you might miss the opportunity to configure dynamically (e.g. links, spamprotection, ...)

Solution 2 could be complicated if you want a plugin and the plugin can not be configured by pure typoscript (or the configuration collided with the configuration of the plugin in the main content)

Solution 3 needs a special (unvisible) page where the CE is stored and can be edited. In your TS you render it with the CONTENT object and use a hard coded uid. You need to remember that special place and special CE. (an editor might 'replace' the CE and wonder why it goes missing)

Solution 4 enables you to use 'normal' editor functionality (configure the plugin as a CE), but might cost some more rendering time because of the sliding and you need to define a special column with additional handling.




回答3:


In addition to Bernd's answer, this is the simplest solution using 1) with TypoScript and some constants for the simplest ke_search input field, but this could be even hardcoded in your html template and it would still work. It's just a GET query that's being sent to the result page – where you set the searchbox again by page plugin.

temp.search = TEXT
temp.search.value (

<form action="index.php" id="site-search" name="xajax_form_kesearch_pi1" id="xajax_form_kesearch_pi1" method="get">
        <input type="text" class="search-input" name="tx_kesearch_pi1[sword]" value="">
        <input type="submit" value="{$llSearch}" class="button">
        <input type="hidden" value="{$pidResultPage}" name="id"><input type="hidden" value="1" name="tx_kesearch_pi1[page]" id="pagenumber">
      </form>
)


来源:https://stackoverflow.com/questions/40787318/insert-plugin-into-a-fluid-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!