The module "Search" provides a search function for ConPresso frontend as well as for its backend.
Content editing users can use the module in the backend for researching article contents. In the frontend visitors of the ConPresso project can search through sections that have been specified for this search.
The search function is considered a basic function in ConPresso, therefore it is included in the default installation of ConPresso since version 4.0.5. However, you can also install the module later (e.g. if you have ConPresso versions 4.0.0 to 4.0.4). Download the module from ConPresso-Website. For more information please read Section 2.1, “Installation of the Module "Search"”.
The search function has been realized as a module on purpose, that way it can be used several times in the frontend. You can configure the function and the layout of this module differently in different installations. This is necessary, for example, if you do not only want to provide a standard search function in your ConPresso frontend but also a special search function for a particular section (e.g. the FAQs).
Note | |
---|---|
You do not have to obtain a registration for this module. You can use it for commercial as well as for non-commercial ConPresso installations. Please note, though, that other modules may require a registration and that you may have to obtain a "License for commercial use". |
The module "Search" is part of the default installation of ConPresso (since version 4.0.5). If you would like to install the module for an older ConPresso version, please read the following instructions.
If you are planning to provide multiple search functions in the frontend of your project a multiple installation is required. To install the module please proceed as follows.
Please download the archive containing the current version of the module from the ConPresso-Website and save it locally. .
After downloading the archive unpack it locally, that is to your computer. Name the module directory as you like (e.g. "mod_search" or "mod_search_faq") and transfer it to the ConPresso directory of your project via FTP.
Note | |
---|---|
If you are using a ConPresso version above 4.0.5 and if you want to carry out an additional installation of the module, you can also download your existing module directory, rename it and upload it again to your ConPresso directory. |
In the ConPresso backend click on the entry “
” in the menu “ ”.Install the module by clicking on the button Install in the column “Manage”. Then activate the module by clicking on the button Activate module in the column “Manage”. For mor information on the installation, activating and uninstalling a module please refer to Section 1, “Manage Modules”.
After the installation of the module the backend navigation will list the entry “
” so that users can search through the backend of the ConPresso project.You can configure the search module for the ConPresso frontend. You can specify, for instance, in which rubrics the search should be performed, how many hits you want to be displayed on the output-page and how the output should be formatted.
Configure the module's settings in the view “Configure module settings”. Open this view by clicking on the entry “ ” in the menu “ ” and pressing the button Configure module settings in the column “Manage”.
Use the settings of “Rubric restriction” to limit the search to specific rubrics. This should be done if you want to exclude certain rubrics from being searched. Choose the option “include”, to include the rubrics selected in “Rubrics” into the search function. Choose the option “exclude” to exclude the rubrics selected in “Rubrics” from the search function. | |||||||||||||||||||||||||||||||||||
The settings of “Rubrics” correlate with the settings of “Rubric Restriction”, if you specify which rubrics should be included in the search function and which ones should be excluded from it. Highlight the rubrics you want to in- or exclude. To highlight several rubrics, hold down the shift or ctrl key (shift or apple key on a Mac) while clicking on the rubrics. | |||||||||||||||||||||||||||||||||||
If you want extend the search function to the names of article authors, links, images and files please check the relevant boxes.
| |||||||||||||||||||||||||||||||||||
Here you can specify how many results should be listed on the output-page. | |||||||||||||||||||||||||||||||||||
The search results will show the search term highlighted in its context. How much of this context will be displayed is specified with the setting “Number of Characters”. Please enter the number of characters (e.g.50) to be displayed. | |||||||||||||||||||||||||||||||||||
The publication date can be an additional information in the list of search results. If you choose to display this information you can use the setting “Date Format” to specify the format of the publication date. | |||||||||||||||||||||||||||||||||||
Use the template to format the input and output layout of the search function. The following placeholders are available:
| |||||||||||||||||||||||||||||||||||
Please enter the class that defines the format for highlighting the search term within the search results. | |||||||||||||||||||||||||||||||||||
Please enter the message that should be displayed if the query was sent off without a search term. | |||||||||||||||||||||||||||||||||||
Please enter the message that should be displayed if the query does not produce any results. | |||||||||||||||||||||||||||||||||||
Please enter the message that should be shown above the results. To display the number of results please use the placeholder "%s". |
There are two ways of integrating the search module into the ConPresso frontend.
The first way is to refer the visitor to the input page of the search module. For that purpose you have to embed a link leading to this page into the article itself or, alternatively, into the header or footer file.
If you have installed ConPresso in the directory
conpresso
on your webserver "http://www.example.com" and if the module is
in the default directory mod_search
,
please use the following URL or adapt the URL according to your settings:
http://www.example.com/conpresso/mod_search/index.php
Of course you can also integrate the search module into the navigation of your ConPresso project. For that purpose, generate a new navigation element at the desired location and enter the URL named above as the “external link”. For more information on editing the navigation please read Section 5, “Edit Navigation”.
The graphical appearance of the search field and the search results is specified in the module's settings as described in the section called “Configure Module Settings”.
The second way of integrating the search module consists in inserting the search field into a header or footer file. If you use the gobal header or footer, the search field will be available in all pages generated by ConPresso. For more information on headers and footers please refer to Section 2.1, “Customizing Header and Footer Files”.
You may use the following code example.
Example 13.1. Search form for the backend
<form method="get" action="../mod_search/index.php" > <input type="hidden" name="action" value="search" /> <input type="hidden" name="rubric" value="<?php echo $cpoRubric['id']; ?>" /> Please enter a search term:<br /> <input type="text" name="q" value="" /> <input type="submit" value="Search"> </form>
Note | |
---|---|
Please note that you might have to change the path to the index file of the respective search module in the first "<form>" line. |
To get to the search function please click on the entry “Search” in its work space. Use the search function if you want to search contents for various criteria.
” in the ConPresso navigation. ConPresso will open the view “Please enter the search term here. | |||||||||||||||||||||
Please specify which elements should be searched.
|
The search result output consists of a message reporting the number of articles found and showing the list of search results. This list view resembles other list views in ConPresso and provides similar functions. The search result list contains the following columns:
The column “Title/Author” shows the title of the article as well as the name of the author and the name of the user who last edited the article. The title is preceded either by a green or orange coloured box. The colour indicates whether the article can be seen in the frontend of the project or not. | |
The column “Rubric” shows the name of the article's rubric. If you want to edit the article, select its rubric first by clicking on it. | |
The column “Status” shows the approval status of an article. For more information on the topic of approving an article please refer to Section 2.1, “The ConPresso Approval Mechanism”. | |
The column “Publication” displays the information on the publication period of an article. For more information on the topic of publication periods please refer to Section 2.2, “Publication Period”. | |
The column “Context” displays the search term with the context it was found in. |
In the frontend of your ConPresso project the module "Search" provides an input field into which visitors can enter their search terms. The output of search results depends on the module's configuration as described in the section called “Configure Module Settings”).
For more information on providing the search function in the ConPresso frontend please read the section called “Integrating the Module into the ConPresso Frontend”.
Note | |
---|---|
The search function in the ConPresso frontend performs searches with regard to restricted and personalized rubrics. Thus it makes sure that frontend users can only see contents they are intended to see. The search function will not produce search results from restricted rubrics for users without the appropriate access rights. Frontend users with differing access rights will therefore see different outputs. For more information please refer to Chapter 16, Restricted Sections and Personalization. |