Skip to main content

Filtering Iframes with Custom Attributes

It is possible to add URI arguments onto the end of some of our Iframe links to filter down to specific information.

There may be other times where you may need more control over filtering than the arguments we offer.

One of the ways this can be achieved is using custom attributes.

Custom Attributes

There are lots of reasons a client may want to filter the items displayed within an Iframe. Below are some common examples of this:-

  1. A page on the website to link to only events that are part of a particular festival.
  2. A page on the website that only displays merchandise items associated with a particular show or gallery installation.
  3. Two separate pages for your memberships, one for corporate memberships and one for general memberships.
  4. A donations page for a specific fund without displaying all available online funds.
tip

Our Webcomponents can also be used for more nuanced control of Donations, Memberships and Merchandise.

Creating Attributes

Filtering Iframes relies on the creation of custom attributes. Attributes can be created by a member of the venue's team in the "Settings" interface in Spektrix.

Each attribute can be either a:

  • Currency Field
  • Date/time Field
  • Drop-Down List
  • Text Field
  • Check-box

For the purposes of filtering we recommend Drop-Down Lists or Check Boxes.

Once an attribute has been created, it's value needs to be assigned to the relevant Event or Item in the "Admin" section of Spektrix.

Referencing Attributes

Selecting the correct Iframe

The following Iframes can be filtered using attributes:

Adding an attribute filter

Filtering uses the Attribute Name and Value in a URI parameter.

?Attribute_{{Name of Attribute}}={{AttributeValue}}

For example, if I made a Genre attribute and one of the values was Comedy;

?Attribute_Genre=Comedy
warning

Attribute Names and Values are case and string sensitive. If the Attribute names or values use any spaces, URL encode the space as %20 .