Hi,

I'm manually calling a view to create list of checkboxes for a form. One field in my node is a select list (1 | First, 2 | Second - for example), if I preview the view in the views ui it shows the value 'First' for my field.

However, when I manually call the view with views_get_view, add any args, then call view->execute(), in the result I get the key ie. 1 & 2 instead of First & Second...

Most likely another rookie mistake, but I've spent a while looking into it with no joy, so I thought I'd ask the experts. Thanks for your time and I'd appreciate any feedback.

Comments

merlinofchaos’s picture

Status: Active » Fixed

Yes, the result contains the raw database keys. What you probalby want is to call $view->render and then look at $view->style_plugin->rendered_fields

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jdeg’s picture

This is usually useful when we need to get the path of an image field.

Thanks!

Steven.Pescador’s picture

Shoulda said this earlier too.... Thanks Merlin of Chaos.