Shortcode: book_search_link
The [booksearch_link] is a paired _shortcode that enables you to create a link that takes the user to another page on your site that displays specific search results.
This shortcode (in brackets) contains the parameters that will define which items you want included in the search result. The available codes are listed below.
In between the paired shortcodes you should put some text that explains what you will be searching for. Suppose, for example, that books on horses was one of your specialies and you wanted to send customers to a page that showed all your books on horses, with the most recent arrivals at the top. You could do that by creating a book search link that looked like this:
[book_search_link all_text="horse" sort_by="added" sort_order="desc" price_min="50"] A selection of our books on horses [/book_search_link]`. (Note that you need to have the code "[/book_search_link]" at the end.
The book search link can be used with any page or post on your site. For example, you might want to include one in a blog post you had written regarding horses, or on a page that described all your specialties and included links to books in each group.
Also note that you can use the sku_id parameter to select one or several specific books. This would be a relatively simple technique for putting a new catalogue or list on your site.
- all_text – Search all the text fields on each book and only display those that match. This a text search rather than an exact match.
- title – Search books by title and only display those that match. This a text search rather than an exact match.
- author – Search books by author and only display those that match. This a text search rather than an exact match.
- keyword – Only show books that have this keyword. This is an exact match.
- tag – Only show books that have this tag/category. On most sites this is an exact match. You can add multiple tags here, separated by commas.
- exclude_all_text – Excludes any books that contain this text in any text field. This a text search rather than an exact match.
- sort_by – The field to search the books by. Available values are
"author"
,"title"
,"year"
,"price"
and"added"
(the date the book was added to the database). The default value is "title". - sort_order – How to apply the sort_by parameter. Available values are
"asc"
(ascending) and"desc"
(descending). The default value is"asc"
. - page_size – The number of books to include on one page of the book listing. If you don’t include paging controls then this will be all the books users can see. If using sku_id this will be changed to match the number of books requested. This should be given as a whole number between 1 and 100. The default value is 20.
- price_min – Only display books of this price and above.
- price_max – Only display books of this price and below.
- year_min – Only display books published in this year or later.
- year_max – Only display books published in this year or earlier.
- first_edition - When set to
"true"
only books marked as first editions will be shown. When set to"false"
only books that aren't marked as first editions will be shown. This will only work properly if these values are included in the book data you've given. - signed - When set to
"true"
only books marked as signed will be shown. When set to"false"
only books that aren't marked as signed will be shown. This will only work properly if these values are included in the book data you've given. - dust_jacket - When set to
"true"
only books marked as having dust jackets will be shown. When set to"false"
only books that aren't marked as having dust jackets will be shown. This will only work properly if these values are included in the book data you've given. - sku_id – Define a book or books that should be displayed. Note that all the other filtering options will still be applied, so you could end up with less books than you list here. Valid values are a single SKU ID or multiple SKU IDs separated by commas, e.g.
[book_search_link sku_id="AB12, AB34, TY67"]Some books[/book_search_link]
.