Semantic views

32
Semantic Views And More!

description

How Semantic Views works in Drupal and some other ways to control your output with Views.

Transcript of Semantic views

Page 1: Semantic  views

Semantic Views

And More!

Page 2: Semantic  views

merlinofchaos Logrus, Inc

Earl Miles

• Views• Panels• Chaos Tool Suite• Nodequeue• Advanced Help• D6 theme system• D7 AJAX System

Page 3: Semantic  views

What is Semantic Views?

• Originally a module by Benjamin Doherty (AKA bangpound)

• Control HTML elements for semantic meaning.• Site builders wanted fewer places to look for

Views configuration.• Views templates are difficult to master.• Provides more power through the interface.• Undoes the powerful concept of separation of

logic and presentation.

Page 4: Semantic  views

Basic views output

Page 5: Semantic  views

Basic views output

Field Element

Page 6: Semantic  views

Basic views output

Label Element

Page 7: Semantic  views

Basic views output

Wrapper Element

Page 8: Semantic  views
Page 9: Semantic  views
Page 10: Semantic  views
Page 11: Semantic  views
Page 12: Semantic  views
Page 13: Semantic  views
Page 14: Semantic  views
Page 15: Semantic  views
Page 16: Semantic  views

Semantic Summary

• Complete control of the HTML within the row• Complete control of the classes within the row• Pair with your custom CSS• Great when the view builder understands

HTML/CSS

Page 17: Semantic  views

Downsides

• Not so good when you really want to separate logic from presentation.

• When your views authors are not themers and don’t understand what your themers want.

• Views row style template now even harder to modify due to all of the moving parts.

Page 18: Semantic  views

But I want to group fields together!

• So do I!• Can’t do this in the Views UI.• But you can use a panel layout with Views.• You can also use Display Suite, but I’m not

going to cover that.

Page 19: Semantic  views

Like this!

Page 20: Semantic  views

Instant grouping!

Page 21: Semantic  views
Page 22: Semantic  views
Page 23: Semantic  views

Things to think about

• Flexible layouts are easy to make, but have heavy markup.

• Layout plugins are not difficult to write. There are many tutorials available on google.

• .inc file, regions, css, template, preprocess• Can then customize layout however you need.

Page 24: Semantic  views

View context + Panels

• Allow you to put rows within a layout.• Allow you to select which fields per row.• Allow you to place things in between your

rows.

Page 25: Semantic  views
Page 26: Semantic  views
Page 27: Semantic  views
Page 28: Semantic  views
Page 29: Semantic  views
Page 30: Semantic  views

Making the fields easy to ID

Page 31: Semantic  views
Page 32: Semantic  views