Insert plugin into a fluid template?

2019-08-04 05:32发布

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.

3条回答
虎瘦雄心在
2楼-- · 2019-08-04 05:44

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" />
查看更多
狗以群分
3楼-- · 2019-08-04 05:45

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.

查看更多
混吃等死
4楼-- · 2019-08-04 05:49

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>
)
查看更多
登录 后发表回答