Semantic Views Module for Drupal 6 - Video Tutorial
- 15 Comments
- Latest Comment
The Semantic Views module for Drupal 6 allows you to easily insert HTML markup for your Views rows and fields.
This is a new module by bangpound and I think this is really going to change how we think about theming Views because for the first time it puts clean semantic Views output in the hands of site builders and other end users, without having to get their hands dirty in the templates.
Semantic markup is intrinsic to good accessibility, SEO, if not the development of the web as whole. It can also make theming a lot easier—we no longer need to litter our stylehsheets with all those extra classes.
I can see this module becoming a big part of our theme development, both for client and commercial themes, where we can provide a Views export module.
Usage is quite strait forward.
-
Simply select the Views Style as
Semantic Views : Unformattedand set the Row style element, such as adiv. Here you can also group elements and apply an HTML element and there are options for setting CSS classes. -
Select the Row Style as
Semantic Views : Fields. Here you can set the HTML element for each field. For example you can seth2for a title andpfor other the other fields.
Heres a quick and dirty vid showing how to use the Semantic Views module. I make the assumption that you have already installed the required modules (Views and Semantic Views). In the video I create a basic node view with a few fields and set a row style wrapper div and HTML elements on each field.
Drupal Version:
Drupal Development:
Drupal:
Comments
#2 Brilliant!
I was thinking of doing a Views style plugin like this and now here it is. Rule 35!
#5 nice man!!!
nice man!!!
#6 thanks
Thanks for this nice article/explanation.
#7 Looks like this is going to
Looks like this is going to make theming alot more fun!
One questions arise though - What about performance?
Have you made any test comparing file based theming with semantic views themeing?
#9 performance
@s.Daniel
The performance is more or less identical to Views 2’s default style and row style plugins. The only differences would be in the theme preprocess functions, which don’t do anything wildly different from what Views already does.
#10 Awesome dude…those classes
Awesome dude…those classes can be a real pain!
#11 Comprehesive! Unpublished
Thanks for this really useful introduction. Do you use this development methodology solely for prototyping, or also on production sites with version control requirements?







#1 thanks jeff
Thanks Jeff for introducing Semantic Views.
Views theming is really pain. I always hated to look the source code in firebug. It undermines the ‘cascading’ theory of CSS.
Thanks, noussh.