Hello,
is set up a view with views cloud as style and it works fine.
I want to make the title field as link and that doesn't work properly.
I have one field, wich gives me the nid and is excluded from output.
If I use [title] as replacement pattern it works, if I use [nid] as replacement pattern it doesn't. I get the same nid for every link. In my case 6
Please have a look at my screenshot.
Any suggestion, how to solve my Problem?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | duplicated-nid-893054-2.patch | 651 bytes | dan.nsk |
| screenshot.png | 214.97 KB | shopdogg |
Comments
Comment #1
shopdogg commentedUsed a views custom field to solve the problem.
Comment #2
dan.nsk commentedI am also experiencing this bug. When I am trying to "output а field as a link" or "rewrite the output of а field" and use the [nid] as a pattern, each cloud’s element being given the same substituted value for nid.
I am not an expert in the views module’s internals, but after investigating the template_preprocess_views_cloud_style() in views_cloud.module and comparing its logic to the template_preprocess_views_view_table() function (in views/theme/theme.inc) I realized that the first one was probably the source of the problem.
Specifically, I noticed the following fragment in template_preprocess_views_view_table():
In template_preprocess_views_cloud_style() each field gets themed separately:
So I decided to rewrite this block using the template_preprocess_views_view_table()’s logic. After that my view began to work properly.
I am attaching the patch for the views_cloud.module. I don’t think it should be used in production environment as I don’t fully understand this function’s logic. The patch should rather be reviewed by the module’s maintainer.
Comment #3
dan.nsk commentedSetting the proper status
Comment #4
vacilando commentedRan into the same bug...
Comment #5
wapnik commentedThe patch looks good...
Comment #6
soulfroysThe patch works! Tks!
Comment #7
kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.