Theming: Another approach

Skip to first unread message

May 10, 2013, 9:58:39 AM5/10/13
Muy interesante enfoque y es cierto Muchas veces no necesitas usar Views en D7.
Basta con crear Views Modes (modos de display) con el modulo Entity View mode y luego usar la administracion de campos para configurar que campos y como quieres verlos por cada modo de display.
Asi, ya no necesitas usar views, y si necesitas themear solo vas a los tpl de cada modo de display.
Resultado? menos queries y mas rapido de desarrollar en sitios no tan complejos :)

Theming as it should be

View modes (D7)

view the slides

  • Nothing to do with Views
  • Makes you theme faster
  • Works with all entities: Nodes, users, taxonomy
  • Built-in View Modes: Default, Full, Teaser, RSS
  • Enable built-in View Modes: Click on “Custom display settings” on contenttype 
  • No need to make custom .tpl files for every node type…
  • Just theme your view modes...

Add more view modes (3 ways):

  • Module: Entity View mode
    • Simple lightweight
    • Does what it says
  • Module: Display suite
  • In Code: hook_entity_info_alter()

Use Node References and pick the View mode of your choice

Search results, Search index are also view modes


  • Consistent design is the key! Duh!
  • Avoid inconsistancies in your design, makes life simple
  • Doesn’t work if you want to output fields of multiple/related nodes

Why View Modes? Because we theme too much, use to much PHP and too much views. Plus, little detail, it's the core Drupal way of configuring. So why shouldn't we use it?

More info:

The new Panels universe

  • Drag ‘n drop panels between panel regions

  • Page manager

  • In place editor

  • Locking panes to certain regions

  • Form to edit a single field on a single entity

  • Entity Revision Scheduler

  • Fieldable Panel Panes

    Module: Panels everywhere

    Module: Panelizer

    Distribution: Panelopy

    • An entity that can be added as a pane
    • Create on the fly or in administrative UI
    • Full access control
    • Support bundles through a hook (no UI)
    • Like BEAN module for blocks
    • Like panel nodes, but with context
    • For any node
    • Or user
    • Or taxonomy term
    • By bundle
    • With defaults
    • That can be picked by the node editor
    • Distribution based on panels
    • Should provide a fantastic starting point for site building

Why panels? Because it's more flexible and visual for site builders, themers and content administrators.

Oh yeah, and then there's Display Suite. To be continued or just Google it. Of beter nog: werkt nog 'n beetje!

Reply all
Reply to author
0 new messages