Skip to content

Updating the switch tag example and variable #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/add-ons/search/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ The Search Results Tag controls how you display results from your searches. Exam
<th>{lang:recent_comments}</th>
</tr>

{exp:search:search_results switch="resultRowOne|resultRowTwo"}
{exp:search:search_results}

<tr class="{switch}">
<tr class="{switch="resultRowOne|resultRowTwo"}">
<td width="30%" valign="top"><b><a href="{auto_path}">{title}</a></b></td>
<td width="30%" valign="top">{excerpt}</td>
<td width="10%" valign="top"><a href="{member_path='member/index'}">{author}</a></td>
Expand Down Expand Up @@ -110,6 +110,14 @@ This parameter is replaced with the URL to the entry with the Entry ID appended

The Template_Group/Template with which to display the member profile of the author of the entry. Typically, this variable will be specified as {member_path='member/index'}.

### `{switch=}`

{switch="option_one|option_two|option_three"}

This variable permits you to rotate through any number of values as the entries are displayed. The first entry will use "option_one", the second will use "option_two", the third "option_three", the fourth "option_one", and so on.

Multiple instances of the {switch=} tag may be used and ExpressionEngine will intelligently keep track of each one.

## Search Keywords Tag

This tag lets you display the keywords used to perform a search. It is used on the search results page in order to show the user exactly what search terms they used:
Expand Down