iFrame Example

The following example demonstrates how database fields can be passed to a website in an iFrame (in this case, passing two postcode fields to Google Maps to produce a map with directions):

Please note that this example will only work properly with centres that have a postcode entered for them.

  1. Create a new tab in the Centre entity and add an Internet Frame control.

  2. Click Add Substitution.

  3. Two dropdown boxes, table name and field name, will be displayed. The list of available tables is determined by the type of tab. Since the tab in this example is a Centre tab, the available tables are Centre, Organisation and Trainee. Choose Trainee for the first box and POSTCODE for the second box. Note that this substitution is called $arg0$.

    You can remove a substitution by clicking the blue cross on the right.

  4. Click Add Substitution again and select Centre and POSTCODE from the two boxes. This substitution is called $arg1$.
  5. Set the URL as follows:

    http://maps.google.co.uk/maps/dir/?api=1&origin=$arg0$&destination=$arg1$

    There are a number of parameters which can be passed to Google Maps. Normally when using postcodes in Google Maps, the search term would be passed to the URL in the following format:

    dir/?api=1&origin=LA1+2BC&destination=LA2+3DE

    In Maytas 5, we can substitute the parameter postcodes with our own fields:

    dir/?api=1&origin=$arg0$&destination=$arg1$
  6. Click OK.
  7. Select the frame, then set the Min Height (on the right) to 600.
  8. On the overview panel (on the left) for the tab, ensure that Published is ticked and click Apply on the ribbon to save the changes.
  9. Now when you open a learner, you should see a tab which looks similar to the one below:

This is one of many things that can be achieved with iFrames. Please contact Maytas Support if you have any questions regarding iFrames or would like help with setting one up.