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
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

jferjan - April 8, 2009 - 10:47
Status:active» closed

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

jferjan - April 8, 2009 - 12:00
Status:closed» 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

#3

merlinofchaos - April 8, 2009 - 15:24
Project:Views» 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.

#4

TheAlienShore - May 29, 2009 - 20:21

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

#5

Janam - October 26, 2009 - 02:46

subscribing

#6

markus_petrux - October 26, 2009 - 15:23
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.

#7

System Message - November 9, 2009 - 15:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.