Searching in TYPO3

You can use searching in TYPO3 without downloading any extra extensions. For this functionality in TYPO3, there is the system extension "indexed_search".

Search extension installation

You should switch to the Extension Manager for using this extension, as you can see in the following screenshot:

Search extension installation

You need to install this extension by pressing the + icon next to the extension title Indexed Search Engine. Starting installation TYPO3 will inform you that the system couldn't find the doc_indexed_search extension. This extension includes documentation for searching extensions and you will be able to import it. You can import from the Extension Manager's side or by visiting the TYPO3 extension repository; from here it can be downloaded and installed without assistance.

You have two options at this stage: complete documentation installation or cancellation. Then, you can move on to the next step—importing the database's tables. This is required for searching the driver operation.

On the Indexed Search Engine extension installation, you will be able to manage the extension configuration, as you can see in the following screenshot:

Search extension installation

Most of these options are for parse office documents using special software—for example catdoc, xlhtml, pdftotext, and pdfinfo (Xpdf).

If you specify this software location on your server, indexed searching can display the results as a plain text. Then, the changes are made and the chosen options are approved.

Adjusting the ABC template

Most people who use TYPO3 switch off comments using the TypoScript function. Therefore, we need to define for, which content will or will not be considered in our page.

If you don't specify it, the search results will display parts of menus, language menus, and unnecessary information.

To switch off comments that generate TYPO3 extensions, this TypoScript code can be used:

config.disablePrefixComment = 1

In this way, comments of element blocs and extensions will be taken from the page source.

<!-- CONTENT ELEMENT, uid:29/textpic [begin] -->

We use the HTML document. We add comments to the template showing where the block begins and where it ends; also, this comment specifies what the search needs to index:

<!--TYPO3SEARCH_begin-->
<!--TYPO3SEARCH_end-->

In our template it looks like this:

<!-- ###DOCUMENT_BODY### -->
<div class="container">
<div class="header">
<div class="logo">###LOGO###</div>
<div class="topmenu">###TOP-MENU###</div>
<div class="language">###LANGMENU###</div>
</div>
<div class="main">
<div class="sidebar">###LEFT###</div>
<!--TYPO3SEARCH_begin-->
<div class="post">###CONTENT###</div>
<!--TYPO3SEARCH_end--> </div>
<div class="footer">###FOOTER###</div>
</div>
</div>
<!-- ###DOCUMENT_BODY### ->

In our example, the ###DOCUMENT_BODY### marker marks the start and end of the template. This means that TYPO3 will ignore all the markers that are out of this marker field. All the necessary markers should be wrapped in this marker's borders.

You can choose another title for your website template's start and end markers; for example, ###BODY_CONTENT### and specify this title in the TypoScript configuration:

workOnSubpart = BODY_CONTENT

Accordingly, you need to add a line of TypoScript code in your page configuration. Then, you can use indexing in the page and the searching form will work:

page.config.index_enable = 1

Once the installation of the "indexed_search" extension is complete in the administrative section (Backend), you will see a new section called "Indexing" (under the base section "Admin tools").

The content gets indexed during the rendering of the pages, and content is not indexed if you are logged into the backend. To set up content indexing, you should visit your page from FE—this will trigger the indexing of page content.

If you do these steps correctly, your pages will be indexed.

Adjusting the ABC template
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.81.58