One topic from that night was using Views and CCK OR making your own modules

yurtboy's picture

There are some good reasons on both sides as which way to go.
Do you build your own module to make the pages you need or just make a View and CCK fields?

The next day at work I noticed a couple of sites where I had to decided which way to go.

Here are some examples.

Cradle Family
This site has a number of views and ALL of them use Taxonomies and Multiple terms from the same Vocabulary for each node. So this one view is a good example http://cradlefamily.com/Events of a simple view that had a repeat of nodes showing up if that node was had more then ONE term. To fix this I had to hook the view and alter the sql a minor amount.
I did try using the Distinct option that views offers but there was not luck there. And here is the warning even it gives you.
"This will make the view display only distinct items. If there are multiple identical items, each will be displayed only once. You can use this to try and remove duplicates from a view, though it does not always work. Note that this can slow queries down, so use it with caution."
But overall it worked out better NOT to build my own module.
This same site has another view that I still need to fix up cause of this duplication problem.
http://www.cradlefamily.com/classes/Mom%20and%20Baby%20Groups/all
(if it works at all since sometimes it times out - still working on it)
Oh well.

Here is another place
http://www.ophthalmicedge.org/videolibrary
This site could NOT have been done with a view (I think) but it is custom code that then calls to views_embed_view to do some of the tedious work. I fealt it was to hard to get the right layout I needed using Views.
I tried even using Views Group By Option to group by the Parent Term but it just was too much work to get it right.

So both of these sites benefit from Views and CCK but the second one was, I thought, too much for a View. And the first one had a flaw with Views (though it could have been me?) that made the work to fix it make me wonder if I should have just used drupals functions and a custom module to make it happen.

Though I still think Views and CCK are key to making drupal easier to develop on and eliminate a TON of coding I use to do.

Login to post comments

Views/CCK First

skowyra's picture
skowyra - Sun, 2009-11-01 14:39

I think we are approaching this the same way. I tend to look for a Views/CCK solution first. If not, then build a module.


I find myself using views_embed_view

yurtboy's picture
yurtboy - Tue, 2009-11-03 14:39

Whether I use views or my own code this little function saves a ton of layout and query work!
http://thedrupalblog.com/embedding-view-drupal-6-using-views-embed-view

Even inside of a view template file so I can use a view in a view.

Alfred Nutile
River Valley Tech Collective
alfred@rvtc.us
http://twitter.com/rvtctweat
http://www.rvtc.us