Skip to content

Commit

Permalink
[TASK] Update default configuration and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbltr committed Feb 23, 2024
1 parent de7ef58 commit 5fb1491
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 23 deletions.
26 changes: 25 additions & 1 deletion Configuration/TCA/tx_kesearch_indexerconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@
'cols' => 48,
'rows' => 4,
'eval' => 'trim',
'default' => 'text,textmedia,textpic,bullets,table,html,header,uploads,shortcut,accordion,tab,carousel,icon_group,card_group,timeline',
'default' => 'text,textmedia,textpic,bullets,table,html,header,uploads,shortcut,accordion,tab,carousel,carousel_fullscreen,carousel_small,icon_group,card_group,timeline',
],
],
'additional_tables' => [
Expand Down Expand Up @@ -498,19 +498,43 @@
fields[] = header
fields[] = subheader
fields[] = bodytext
fields[] = nav_title
fields[] = link
[carousel_fullscreen]
table = tx_bootstrappackage_carousel_item
referenceFieldName = tt_content
fields[] = header
fields[] = subheader
fields[] = bodytext
fields[] = nav_title
fields[] = link
[carousel_small]
table = tx_bootstrappackage_carousel_item
referenceFieldName = tt_content
fields[] = header
fields[] = subheader
fields[] = bodytext
fields[] = nav_title
fields[] = link
[icon_group]
table = tx_bootstrappackage_icon_group_item
referenceFieldName = tt_content
fields[] = header
fields[] = subheader
fields[] = bodytext
fields[] = link
[card_group]
table = tx_bootstrappackage_card_group_item
referenceFieldName = tt_content
fields[] = header
fields[] = subheader
fields[] = bodytext
fields[] = link
fields[] = link_title
[timeline]
table = tx_bootstrappackage_timeline_item
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 94 additions & 22 deletions Documentation/Indexing/IndexerTypes/Pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ which are delivered by the TYPO3 core:
* File lists (CType `uploads`)
* Referenced content elements (CType `shortcut`)

Additionally it indexes content elements provided by the EXT:bootstrap_package,
these are the following CTypes:
Additionally it indexes content elements provided by the EXT:bootstrap_package:

* `accordion`
* `tab`
* `carousel`
* `icon_group`
* `card_group`
* `timeline`
* Accordion (CType `accordion`)
* Tab (CType `tab`)
* Carousel (CTypes `carousel`, `carousel_fullscreen`, `carousel_small`)
* Icon Group (CType `icon_group`)
* Card Group (CType `card_group`)
* Timeline (CType `timeline`)

File indexing
=============
Expand All @@ -60,7 +59,11 @@ In the page properties there's the field :guilabel:`Abstract for search result`
in the tab :guilabel:`Search`. Here you can enter a short description of the
page, this text will be used as an abstract in the search result list. If this
field is empty, it falls back to the field :guilabel:`Description` in the
:guilabel:`Metadata` tab of the page properties.
:guilabel:`Metadata` tab of the page properties. In the FlexForm of the
search plugin you can define the "Text for used for search result
(preview text)" and set it to "Always show the abstract if set" or
"Show abstract if it contains searchword, otherwise show an excerpt from
the content".

Advanced options
----------------
Expand All @@ -77,16 +80,14 @@ Advanced options
own content element types. For example those created with EXT:mask or from
EXT:bootstrap_package. If you are not sure what to enter here, have a look a
the table `tt_content` in the column `CType`.
* (sinde version 5.3.0) In :guilabel:`Additional tables for content elements`
* (since version 5.3.0) In :guilabel:`Additional tables for content elements`
you can define tables which hold additional content. That is used for example
by EXT:bootstrap_package or EXT:mask. You need to define the table name, the
field which holds the reference to the tt_content table and the fields which
should be indexed. The `ini` configuration format is used here. Please have a
look at the default configuration in order how to add your own tables.
by EXT:bootstrap_package or EXT:mask. See below ("Index content from
additional tables") for details.
* In :guilabel:`tt_content fields which should be indexed` you can define custom
fields which should be indexed. Default is here "bodytext,subheader,header_link"
which is used for the default content elements. This is useful if you added
your custom content elements for example using EXT:mask.
fields which should be indexed. Default is here "bodytext,subheader,
header_link" which is used for the default content elements. This is useful
if you added your custom content elements for example using EXT:mask.
* Using the field :guilabel:`Comma separated list of allowed file extensions`
you can set the allowed file extension of files to index. By default this is
set to `pdf,ppt,doc,xls,docx,xlsx,pptx`. For pdf, ppt, doc and xls files you
Expand All @@ -97,11 +98,82 @@ Advanced options
* You can choose to add a tag to all index entries created by this indexer.
* You can choose to add that tag also to files indexed by this indexer.

Example
-------
Index content from additional tables (eg. EXT:mask, EXT:bootstrap_package)
--------------------------------------------------------------------------
Some extension like the widely used `mask` and `bootstrap_package` extensions
store content not in the tt_content table but in additional tables which
hold a reference to the record in tt_content.

This is an example for adding a custom content element types and a custom file reference field.
Since version 5.3.0 it is possible to index those tables without the need
for a 3rd party extension or custom indexer. In the field
:guilabel:`Additional tables for content elements` you can configure those
tables. The `ini` configuration format is used here.

.. figure:: /Images/Indexing/custom-ctype-and-file-reference.png
:alt: Example for indexing a custom CType and file reference field
You need to define the table name, the field which holds the reference to the
tt_content table and the fields which should be indexed.

Options
.......

first line (eg. `[custom_element]`)
The content type, stored as `CType` in the table `tt_content`. You will
also have to add this to :guilabel:`Content element types which
should be indexed`

table
This is the table that holds the content.

referenceFieldName
This ist the field that holds the relation to the tt_content record (the
UID of the record). In EXT:bootstrap_package it is named `tt_content`,
in EXT:mask it is named `parentid`.

fields[]
A list of database fields which should be indexed. If the field is
configured as type "file" in the TCA the indexer will check if it links
to a file and index that file. Otherwise the field will be treated as a
text field and will be indexed like other fields, e.g. the `bodytext` field
in content elements. Links to files will also be resolved here and the
files will be indexed.

Examples
--------

Add this to :guilabel:`Additional tables for content elements` to
index the bootstrap package element "accordion" (remember to also add
`accordion` to :guilabel:`Content element types which should be indexed`:

.. code-block:: ini
[accordion]
table = tx_bootstrappackage_accordion_item
referenceFieldName = tt_content
fields[] = header
fields[] = bodytext
Add this to :guilabel:`Additional tables for content elements` to
index a mask element (remember to also add
`mask_list` to :guilabel:`Content element types which should be indexed`:

.. code-block:: ini
[mask_list]
table = tx_mask_content
referenceFieldName = parentid
fields[] = tx_mask_content_item
This is an example for a some mask elements:

* The element `mask_custom_text_element` adds a field `tx_mask_customtext`
to the `tt_content` table.
* The element `mask_custom_file_download` adds a file download field
`tx_mask_file` to the `tt_content` table.
* The element `mask_list` stores content in the table `tx_mask_content`.

.. figure:: /Images/Indexing/custom-elements-01.png
:alt: Example for indexing a custom elements created with mask 1/2
:class: with-border

.. figure:: /Images/Indexing/custom-elements-02.png
:alt: Example for indexing a custom elements created with mask 2/2
:class: with-border

0 comments on commit 5fb1491

Please sign in to comment.