Using Form fields to specify meta description and meta keywordsYou can specify the Meta Description and Meta Keywords for a page via the Behavior Editor, however this works per-page, and if the page contains variable information derived from a Form, it would be useful to be able to specify these values on a record-by-record basis in the Form.
This is possible to do, using either a Custom View component* or the Sale View component.
First add the fields to the Form which will contain the information, with the following data types. You only need add the fields you want.
- Meta Description - Large Text
- Meta Keywords - Large Text
- Page Title - Text
The titles you give to the fields is not important, although keeping them as shown above would be sensible for clarity.
- Add a Query, and add the fields you have just defined.
- Add a Custom View or a Sale View, based on this Query.
- In the View, select the fields from the dropdowns for Meta Description, Keyowrds, and Page Title.
- Click Update to save changes.
- Embed the View on the page that should show the meta tags.
Note: In most cases you will want the View to display other fields visibly on the page, but this is not necessary - and by default if you don't add any fields to the View then it will appear invisible. However, if you view the page source, you should be able to confirm that the meta tags are present.
* (This feature is not included in the Custom View provided bundled with the Query component, only with the separate Custom View component)
|