skip navigation
Trumba Web Calendar Software
Trumba Help Center What’s New | FAQ | Support Forum | Email Support

Search and filter URL parameters

The search=, filter1=, filter2=, and filter3= parameters enable you to create a more granular view of your events through the URL. You can use these parameters to provide links for common searches. For example, if you run a website at a higher education institution, you could provide a link that displays a list of all events with registration and financial aid deadlines.

To use the search and filter parameters, you append them as query strings to a trumbaEmbed parameter that you add to the base URL for the web page that contains your published calendar. Or, you can use the parameters in the url argument in spud code.

Parameter

search=

Searches the event description and notes fields for a word or phrase.

Values

Enter a single word, exact phrase, or list of words that you want matched. If you enter a multi-word phrase, you need to URL-encode the space character (%20). If you want to enter multiple words by which to search, use an underscore as a delimiter between words.

Examples

Search URLEvents returned
http://www.trumba.com/calendars/trumbauevents?trumbaEmbed=search%3Dtai%20chiEvents containing the phrase tai chi
http://www.trumba.com/calendars/trumbauevents?trumbaEmbed=search%3Dalumni_WashingtonEvents containing the word alumni AND the word Washington.

List popular search terms that link to the search results

You might want to provide visitors with a list of popular search terms, in which each term links to a view of the corresponding search results. For example, if you run a site that lists art events and want to link to a view that displays events with the word "sculpture" in them, here's the URL you'd use:

http://www.yoursite.com/calendar.html?trumbaEmbed=search%3Dsculpture

Note If you want to use a multi-word phrase in a search or filter parameter, you also URL-encode the space character (%20).

To create the same view using spud code:

<script type="text/javascript">
$Trumba.addSpud({
  webName: "calendarname",
  spudType : "main",
  url: {search: "sculpture"}
});
</script>

Tell me more about how search works.

Parameter

filter1=, filter2=, filter3=

If you've configured one or more filter spuds, you can provide filtered views through the URL. You can set up a maximum of three filters

Value

filter1= takes values available for the first filter that you set up; filter2= takes values available for the second filter you set up; filter3= takes values available for the third filter you set up. You can use any filter parameter by itself or you can use the parameters together.

After you configure your filter spuds, consult the Publish Settings tab in the Publishing Control Panel to see which filters correspond to each filter parameter.

In URLs, filter parameter values must be URL encoded:

  • You must wrap the entire filter value string in underscores.
  • If you set up your filters to take multiple values, you can filter by multiple values in the URL by using an underscore to delimit the values.
  • If one of the values contains multiple words, you encode the space character between words as %20.

Examples

The table below shows how to use the parameters with two common filters that you can set up. It uses the Trumba Connect hosted page as the location of the calendar, and it shows the query strings that you would append to your base URL and trumbaEmbed parameter.

In other words, to create the URL, you append a query string example from the table to:

http://www.trumba.com/calendars/yourcalendarname?trumbaEmbed=

FilterFilter query stringEvents returned
Locationfilter1%3D_Arboretum_Events that take place in the Arboretum (whose Location field is set to Arboretum).
Event Templatefilter1%3D_3218_3220_Events whose Event Template field is set to Walking Tour (numeric value 3218) OR Workshop (numeric value 3220).
Location and Event Templatefilter1%3D_Arboretum_%26filter2%3D_3218_Events that take place in the Arboretum AND are of the Event Template Walking Tour.

When using the filter parameter for an Event Template filter, you need to find the correct numeric value for the event template (similar to the way you find the calendar ID for mixin/mixout parameters). To find the numeric value, go to your calendar page, set the filtered view you want, select the RSS link and access the numeric value from the RSS URL, and use that value in the filter parameter.

For example, suppose you want to filter for events of type Deadlines, and the numeric value for Deadlines is 4307. If your event template filter is the first one (filter1), the URL you would create to display the calendar filtered to show events of type Deadlines would look like this:

http://www.yoursite.com/yourcalendarpage.html?trumbaEmbed=filter1%3D_4307_

Using the arts events example from the search section above, if you have a filter for the event template, and you want to display a calendar view with both the Deadlines and Visual Art event templates (numeric value 4412), you'd use this URL:

http://www.yoursite.com/calendar.html?trumbaEmbed=filter1%3D_4307_4412_

In the URL filter1 is the parameter for the first filter you set up. The filter parameter can take multiple values, and you use the underscore as the delemeter before and after each value (so you see two underscores between the two values).

To create the same view using spud code:

<script type="text/javascript">
$Trumba.addSpud({
  webName: "calendarname",
  spudType : "main",
  url: {filter1: "_4307_4412_"}
});
</script>

Encoding underscores and periods in filter values

To use a filter value that contains an underscore or a period, such as a Region defined as WI_Midwest, or a Price defined as Under $10.00, you encode the two characters by preceding them with a period.

  • To encode an underscore (_), use ._

    WI_Midwest becomes _WI._Midwest_

  • To encode a period (.), use ..

    Under $10.00 becomes _Under%20%2410..00_

Return to URL parameter list

Privacy | Terms | Public Calendars