开发者

Link to node in a grouped field in a Drupal View always shows /node/nid

开发者 https://www.devze.com 2023-02-01 03:51 出处:网络
I have a Drupal View which displays a series of training events. Each event stretches over several weeks, where the weeks are some time apart. The view output is simple: the dates and location. For ex

I have a Drupal View which displays a series of training events. Each event stretches over several weeks, where the weeks are some time apart. The view output is simple: the dates and location. For example:

| DATE            | CITY
-----------------------------
| Jan 01 - Jan 04 | Some City
| Feb 01 - Feb 04 |
-----------------------------
| Mar 01 - Mar 04 | Another City
| Mar 05 - Mar 10 |          
-----------------------------
| etc...

The output is a table where the date values are grouped.

Each of the columns correspond to a field added to a content type, i.e. field_event_date and field_event_location. field_event_date may have an unlimited number of values. Each row in the view corresponds to a node.

Problem:

I would like to link the date column to the node. Normally, you'd simply click "Link this field to its node" in the Fields setup area. This then does render the column as a link, but the link itself is rendered as http://www.mydomain.com/node/nid - the exact text node/nid, rather than the actual values you'd expect.

I have also tried to use the Node: Link option as then rewriting the field output using the dates, but it yields the same result. A simple link to the node works fine, but when the field values are grouped, the link generated by the 开发者_StackOverflow社区views module breaks.

Is there a workaround or a different configuration which would allow a grouped field in a view to link to it's underlying node?


Add the corresponding node to the fields list (above the date in order), then rewrite the output of the Date field to use the replacement pattern available to you from the node. If you don't want the node field to show, just exclude it from display.


Perhaps a dummy question, but: Are you very certain that you're doing the rewrite output as node/[nid] (with brackets) and not as node/nid?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号