DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Tutorial 7: Guest book

The aim of this extension is to deal with multiple forms of the same table and to explain how update views can be used. It creates a guest book which is inspired from the extension “ve_guestbook” (Modern guest book) available in the TER. Download this example from the TER (sav_library_example7). This extension uses a table with the following fields:

  • the guest firstname,
  • the guest lastname,
  • the guest email,
  • the guest website,
  • the guest message,
  • a comment field.

We want to have three forms associated with this table:

  • one form for the guest input (FORM),
  • one form for the list of guest inputs (LIST),
  • one form for a teaser of the most recent entries (TEASER).

For the guest input, we want to avoid spams and to control the content. Therefore, we want the following behavior:

  1. The guest will answer to a captcha, then his/her email will be required.
  2. If he/she has given a valid email, he/she will receive a personal link by email.
  3. Using this link, the guest will be able to input data. His/her firstname, lastname and message should be required fields.
  4. The guest input will only appear on your website if you validate the data.

To perform this task, we will use new concepts: the “update view” and the filter “sav_filter_pageaccess” (you already know the filter “sav_filter_abc” used in example 1).