winston's blog

Theming multivalue fields in a view

OK, two hour rule. Took me two hours to figure this out so documenting it here.

This turned out to be much harder than I thought and I'm still not thrilled with the solution.

So I have a multivalue field called "positions". It is an integer cck field and each integer is associated with a text entry like so:
1|Teacher
2|Dean
3|Vice Principal
etc.

This is one field, but a user can select more than one value.

When including this field in a view it wraps each item in the output in a div tag. I wanted it to be an unordered list.

Tried going the route of views theming, but couldn't figure out how to get access to the information I needed!

Finally this pointed me in the right direction...

http://drupal.org/node/556232

End result?

I had to override an obscure theme function in cck!! Namely this one...

http://drupalcontrib.org/api/function/theme_content_view_multiple_field

What's worse it is kind of an all or nothing proposition (at least for that field) as there is no obvious way to get it to behave differently for different views! Yuck.

Anyone know a better way?

Report back from Lower Fairfield Meetup

in

So a small meetup, but hoping to draw larger groups in future. Ideally I'd like this to be along the North Jersey model of being a place to go to work on your projects and get advice.

Yikes I Need to Update My Blog!

Too Too long. And so much good stuff. I went to Drupalcon Paris, came back, started planning for DrupalCamp NYC 7. And I still need to start my problems and solutions section!

Oh well, coming soon I guess.

Drupaldelphia Recap

Just a quick recap of Drupaldelphia. I attended and also gave a presentation on Drupal Community Awesomeness.

Another excellent event. I really love the camps as a way to meet new drupallers and learn new things. The smaller scale vs a con for example very much appeals to me. As I mentioned in my presentation, if you want to get in with the drupal community - find a way to get to real live events!

Drupal Problems and Solutions

Announcing a (coming soon) new feature to my blog (soon as I figure where to stick it on the home page).
Drupal Problems and Solutions will be my quick (and very biased) guide to problems or challenges in building a drupal site (some complex, some simple) and the solutions I've encountered.
Hey, this is mostly for my own benefit. Some place to record my research and thoughts. But I figured, what the heck, maybe it will help someone else too.
So if you are one of my probably very few followers stay tuned.

What are my biases you ask?

  • Simple over Complex
  • Reusable over one time only
  • "Community approved" over "who??"
  • The "drupal way" over some other way
  • Open source and free over closed or proprietary
  • DIY over Yet another module
  • Safe over risky

Sounds like some of these might be contradictory? You betcha! Bias and judgment to the rescue!

DCC - Second Camp in Two Weeks!

Wow, another drupal camp in just two weeks. Between the Boston d4d camp and now Drupal Camp Colorado I've been heavily drupalled. It's a great feeling! The real highlight for these last two camps overall is the incredible jump in my knowledge, but perhaps more importantly some of the awesome people I met (or reconnected with).

Here are my subjective highlights from Drupal Camp Colorado

All the Latest

Wow, so busy. It's a fun time. So rather than try and think this morning, just some quick links to what I've been up to...

There was some cool family stuff too

  • Oldest daughter turned 18! A milestone for her of course, but for me too!
  • Two daughters school graduations this week
  • A pretty cool summer for them coming up (and for me and my wife too)

Emfield Calling

Oh emfield, why do you need information I already have?

In my previous post I spoke about caching issues. Still a valid discussion, but it got me to thinking. For an emfield image provider why would there need to be any calls to the provider api other then when initially creating a node or perhaps when updating the emfield field in a node?

Smugmug provider updates

Just a couple of updates here...

Turns out new emfield providers are being created as separate modules so you can check out mine here.

On another note I've had additional thoughts about caching and emfield providers. Something seems amiss to me so planning to dig in a bit more.

Oh yes, and I'll be adding a video provider for smugmug. Smugmug has pretty nice video support!

A Provider is Added

So I finally did it - made a real contribution to Drupal. It isn't live yet, but I think it is RTBC (Ready To Be Committed). In this case it was a new provider for emfield image allowing users to embed smugmug images into their pages similarly to the existing providers such as Flickr, Photobucket, etc.

Some easy, Some hard...

So was it hard? Well, like all coding some was easy, but there are always gotchas.

Syndicate content