Using cck text field data as views argument
jferjan - April 8, 2009 - 10:21
| Project: | Content Construction Kit (CCK) |
| Version: | 6.x-2.x-dev |
| Component: | Views Integration |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
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.

#1
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.
#2
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
#3
That'd be up to CCK. If it were to work, you'd probably need a validator to transform it to the key.
#4
Was anyone able to figure this out? I'm interested as well.
#5
subscribing
#6
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.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.