My presentation for Drupal Developers Day 2012 @ Microsoft Office in Ayala Makati, Philippines. This will show you how to save Drupal views in code and convert it to custom module.
5. Views can be stored in the database, which is
typical of smaller sites and hobby sites.
However, Views may also be stored directly in the
code as "default" views, (which simply means
they're available by default). Modules often come
with views that are specific to the module data, but
it's also possible -- and highly recommended --
that sites which have separate "development" and
"production" sites export their views into default
views in a site-specific module. This makes it very
easy to transfer views from dev to production
without making database changes.
ADOLFO G. NASOL
6. http://views-
help.doc.logrus.com/help/views/api-default-
views
ADOLFO G. NASOL
7. Less Database Query
You can easily re-use your views
You can versioned it, because it’s a code you
can use Git or SVN to track changes.
You can share it to community
ADOLFO G. NASOL
11. You can use this to create a module to allow
users to enable/disable certain website
components or features generated by views.
Just add hook permission, create menu and a
settings page. Check the sample code at
https://github.com/danreb/rswd_onepage
Note: If you change or adjust your view, just re
export the view and override your view file
then go to view list page and click on revert.
That’s it! Enjoy!
ADOLFO G. NASOL
12. Adolfo G. Nasol
Mobile: 09195951276
Website : http://cavhost.com
Blog: http://danreb.com
Abtik Base Theme:
https://github.com/danreb/abtik
Abtik Outsource: http://abtikoutsource.com
ADOLFO G. NASOL