0

I am stuck with links in views. I need to rewrite one field of a view to a link to a field of view´s attachment.

Basicaly: view displays a grid of images. This view has an attachment. In the attachment is a list of [body]. The click on the image should navigate to appropriate [body] in the attachment.

I have set view (with exposed filter, relationships...), but I cannot think how to set up the link. I added field: nid to the attachment, but still don´t know how to link to it from the main view. Maybe I did something wrong, still learning on the go. Could you, please, help me?

0

So, my mistake, it is quiet simple. If you struggle with similar problem: in the Attachment: -add a field content: NID, hidden

-In global: custom text add, for example, <h3 class=[nid]>[title]</h3>

This way we have an NID anchor we can link to.

In the block view: -add a field content: NID, hidden (so our link field gets NID as a value, not as a string "nid")

-we rewrite some field (for example title): output this field as a link. Link path: #[nid]

Voila, it works. My problem was I forgot to include content: nid in block view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.