Skip to content

Commit 0df3aae

Browse files
committed
[TASK] initial commit
0 parents  commit 0df3aae

5 files changed

Lines changed: 59 additions & 0 deletions

File tree

Configuration/NodeTypes.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'Flowpack.SearchPlugin:Search':
2+
superTypes: ['TYPO3.Neos:Content']
3+
ui:
4+
label: 'Search'
5+
icon: 'icon-search'

Configuration/Settings.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
TYPO3:
2+
Neos:
3+
typoScript:
4+
autoInclude:
5+
'Flowpack.SearchPlugin': TRUE
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{namespace neos=TYPO3\Neos\ViewHelpers}
2+
{namespace ts=TYPO3\TypoScript\ViewHelpers}
3+
SEARCs {searchWord}
4+
<div class="search-results">
5+
<f:if condition="{searchResults -> f:count()}">
6+
<dl>
7+
<f:for each="{searchResults}" as="searchResult">
8+
<f:alias map="{documentNode: '{ts:render(path: \'searchResultDocument\', context: {searchResult: \'{searchResult}\'})}'}">
9+
<f:if condition="{documentNode}">
10+
<dt>
11+
<neos:link.node node="{documentNode}">{documentNode.fullLabel}</neos:link.node>
12+
</dt>
13+
<dd>
14+
<ts:render path="searchResultContentRenderer" context="{node: searchResult}" />
15+
</dd>
16+
</f:if>
17+
</f:alias>
18+
</f:for>
19+
</dl>
20+
</f:if>
21+
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
prototype(Flowpack.Search:Search) {
2+
searchResults = ${Search.query(site).fulltext(request.arguments.search).execute()}
3+
searchWord = "foo"
4+
5+
searchResultDocument = ${searchResult ? q(searchResult).closest('[instanceof TYPO3.Neos:Document]').get(0) : null}
6+
7+
searchResultContentRenderer = ${String.crop(String.stripTags(q(node).property('title') + q(node).property('text')), 300) + '...'}
8+
9+
@cache {
10+
mode = 'uncached'
11+
context {
12+
1 = 'site'
13+
}
14+
}
15+
}

composer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "flowpack/searchplugin",
3+
"type": "typo3-flow-package",
4+
"description": "Add description here",
5+
"require": {
6+
"typo3/flow": "*"
7+
},
8+
"autoload": {
9+
"psr-0": {
10+
"Flowpack\\SearchPlugin": "Classes"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)