I am trying to use cck text field data as a view argument.

My cck text field has following values:
nepoznan
strežnik
virtualni strežnik
virtualni IP
osebni računalnik
diskovno polje
omrežno stikalo
požarna pregrada

Arguments are working ok for single word values (eg. nepoznan), but they stop working if there are spaces in the argument value (eg. diskovno polje).

Is there a way to make spaces work or to replace them with _ or -.
I suppose i need an argument handling code, but i don't know where to put it.
Help would be appreciated.

Comments

jferjan’s picture

Status: Active » Closed (fixed)

I just discovered that spaces are working ok for cck values with spaces.
The problem is only with key values. I was trying to use text field value instead of text field key value.

jferjan’s picture

Status: Closed (fixed) » Active

Any ideas how to use cck text field label value as a views argument?
Views is using key value instead of label value.

My cck field has following values:
key1|label1
key2|label2

viewsURL/key1 works
viewsURL/label1 doesn't work

merlinofchaos’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.4 » 6.x-2.x-dev
Component: node data » Views Integration

That'd be up to CCK. If it were to work, you'd probably need a validator to transform it to the key.

TheAlienShore’s picture

Was anyone able to figure this out? I'm interested as well.

BetaTheta’s picture

subscribing

markus_petrux’s picture

Status: Active » Fixed

This is not supported by CCK itself. You'll have to write a custom argument handler that performs the translation of the label to obtain the value, which is what the query needs.

Another possible approach: do the translation from hook_views_pre_view(). This is documented by Views (see Views project page for links). Also, install Advanced Help module if you haven't already.

Status: Fixed » Closed (fixed)

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