Using Attributes to Filter Iframes

Martin Counter
Martin Counter
  • Updated


There are lots of reasons why you may want to filter the items displayed within an iframe on your website.  Below are some common examples of this:-

  1. You would like a page on your website to link to only events that are part of a particular festival.
  2. You would like a page on your website that only displays merchandise items associated with a particular show or gallery installation.
  3. You would like to have two separate webpages for your memberships, one for corporate memberships and one for general memberships.
  4. You would like to create a donations webpage for a specific fund without displaying all available online funds.



Creating Custom Attributes

Filtering iframes relies on the creation of custom attributes.  Firstly we need to decide on exactly what type of attributes we are going to create, what they will be an attribute for and what they will be called.


Custom Attributes

When setting up attributes for filtering particular items in an iframe you have to add an attribute into the correct part of the system

For example if you are filtering memberships into corporate and general, you would need to create a membership attribute.  The Support Centre article below explains this in more detail:-

 Custom Attributes Support Article 


Types of attributes

In most cases when filtering iframes we advise that you use drop down attributes like the one in the example below.  This way you avoid any potential spelling errors preventing the filtering of items working correctly.

Another type of attribute that you may find useful is the Yes/No or tick box type.  You can see an example of this below.


Naming your attributes

Using the examples listed above, here are some suggestions for names and options for these attributes.

1.  Part of Festival (New Writing Festival, Food Festival, Film Festival) 

2.  Merchandise Type (Panto 2015 Merchandise, Panto 2014 Merchandise)

3.  Membership Type (Corporate, General)

4.  Online Donations Page (Yes/No)

Once you have decided on the name and potential drop down options for your new custom attributes you can create them on your Spektrix system.


Applying the attributes

Once you have created these new attributes in your system you now need to apply these to your specified items.  

Using example number 1 above.  If you were creating an iframe specifically for your New Writing Festival.  You would go through all the events that are part of this festival and set the attribute called "Part of Festival" to "New Writing Festival".


Referencing these attributes in iframe addresses

Everything in this section is covered in significantly more detail in the Spektrix Web Integration Guide

This document is designed for web designers so goes into full technical detail but the relevant information for if the iframe is being embedded in house are as follows:


Standard iframe Address

The first part of your iframe link will always be the same:

NOTE: If you're using Custom Domains, it'll instead be something like

Selecting the correct iframe for the item type

Following this standard address you will need to specify the type of item you will be filtering.  To do this you add the following page:-

eventlist.aspx (for filtering events)

merchandise.aspx (for filtering merchandise)

memberships.aspx (for filtering memberships)

donations.aspx (for filtering funds/donations)

If you test the following web address with your client name inputted, you will see that it links through to a webpage with all of your events listed with no filtering.


Adding an attribute filter

By following any of the above links with:-

?Attribute_Name of Attribute=Value of Attribute

You can then start to filter your results to specific items.  By combining both the Standard Address, Item Type Page and Attribute Filter you can filter exactly what will appear in your iframes.

Please find below how the examples above could be displayed online.  


1. Part of Festival (New Writing Festival)

There are two events as part of this festival, "In My Fathers Words" & "Spektrix the Musical" of Festival=New Writing Festival


2. Merchandise Type (Panto 2015)

There are three merchandise items that are being sold for the Pantomime in 2015.  These are a Programme, Flashing Axe and a Snow White Costume. Type=Panto 2015


3. Membership Type (Corporate)

To display only the corporate membership in an iframe Type=Corporate

4. Online Donations Page (Yes/No) 

To only display one specific fund on an online donations page. Donations Page=1

Once you have tested your link and are happy with the filtering of the iframe, you can pass this over to your web developers who will embed it into a webpage for you. 

As always if you have any questions or problems with this process please get in touch with Spektrix Support, we will be happy to help.