Exercise 14

Working with Views

UI Patterns provide support for views out of the box. However, there are limitation on what you can do with ui patterns and views. See this issue for an example of what ui patterns can and can not do with views.

We will keep things simple to show you how ui patterns works with views and you can continue to explore this topic further as ui patterns is improved on future versions.

Create a views list

In this example we are going to create a list of client quotes using the Quote pattern with views.

  1. Click Structure | Views
  2. Click Add View
  3. Under View name type Testimonials
  4. Under View Settings select Show: Content of type Testimonials
  5. Check the Create a page checkbox (Page title and path fields should both have testimonials)
  6. Click Save and edit

Updating the view's format to use a pattern

  • While in the Testimonials view screen, click the link Content next to Show under the FORMAT section

  • Change the selection from Content to Pattern and click Apply
  • In the Pattern* dropdown, select Quote and click Apply

Mapping the view fields to the Quote pattern fields

  • Click the link Settings under the FORMAT section

  • Map the SOURCE and DESTINATION fields as follows:
    • Content: Title should be mapped with Quote Author
    • Content: Body should be mapped with Quote Body
  • Click Apply
  • Finally, Click Save to save all the changes made to the View
  • In your Drupal site, visit http://your-site/testimonials. Alternatively you can click the View Page button on the top right corner of the view screen.

results matching ""

    No results matching ""