You can provide a search capability through all metadata and indexed text in your app (content item name, title, tag line, etc.). From the search results, a user can quickly navigate to a relevant article.
1. Provide a search option in your app
If you want to allow users to search in your app, you will need to provide them a way to activate the search screen. You can do this by using a special url scheme
tp-search://, e.g. in a 'web link' content item. Tapping the web link will then display a search bar. More info about this URL scheme can be found here.
2. Determine the look & feel of the search results
You can change the layout of the search results by using familiar Twixl platform options:
- The overall layout is defined by a Grid Style of your choice.
- The layout per Content Item is defined by one or more Item Styles of your choice.
If you go to your app and select 'Edit app', you can select a grid and item style that will be used to display the search results.
The grid and item styles used for search are the same as what you can use for the downloads overview, see Custom URL schemes for Twixl apps.
We strongly advise you to use separate Grid and Item Styles for your Search and Downloads results screen. Also, give them a good and logical name (e.g. Search & Downloads Grid Style). That way it will be much easier to organise and select different styles in different Collections / Content Items of your app.
3. Search Mode
You can choose between two options:
- Search in the metadata of the content items only
- Search in the metadata as well as in the actual content of the content items.
Since this functionality also depends heavily on metadata, it is highly recommended that a publisher enters the relevant metadata in all Collections and Content Items of the app. Without that, a search request can show incomplete results. So, don't forget to fill in Title, Author, Tagline, etc.