Hi
I have one view with the [body] limited to 100 words ...wanting to link to another view of the same page with the full [body]

Is there an easy way?

There are a few posts on this but I am not really understanding how to do it.
Thanks
MD

Comments

nevets’s picture

Why not just link to the full node (instead of a view)?

michaeldaly352’s picture

the 'view' is significantly different from the node...it was just a case of wanting to display more text (in a different view) rather than everthing on the full node

rajmataj’s picture

Yes, there is a way to do this. Essentially, you are wanting to link one Views' page to another Views page.

First of all, if you're not familiar with Views arguments, I suggest watching a video or two and reading a few posts that explain it well (you could also try the Views manual). These three have been very helpful to me.

Assuming you've watched those, now you hopefully have a basic understanding of how they work. I can't stress enough that arguments are mostly about understanding how they work systematically, instead of just repeating steps. Having said that, essentially, to link one View to another, you need a common thread between the two Views and that is usually the Node ID (NID).

For my example, I had one content type (article) and made a View listing the titles and dates of all the nodes of this content type in a table. Clicking on the title of an article would take the user to a Views-rendered page of all the article's details. This way, I wasn't stuck with the plain CCK generated output - which is usually easy enough to work with and style but for my uses, I had a lot of dynamic stuff happening that was easier to manage with views (I needed to send detais of the page to a webform, and using Views was the easiest way to do it). So, given that background, here's what you can do:

1. Create an argument calling this Node ID. For my purposes, I've gotten away with minimal adjustments to the argument configuration but you may want to limit the validator to Node and perhaps select a particular content type if you want. Argument Type can also be Node ID.

2. I included the Node ID as a field and checked 'Exclude from display'. Don't forget if you want to use information from a non-displayed field, it's best to put it at the top of your fields list because that is the only way it will become available to fields listed below it. It cascades.

3. Again, my first View is a page showing a table summary of all the nodes of a particular content type. Clicking on the titles would go to the full details page. The title field was set to: Output this field as a link - and the link path was entered as myarticles/[nid]. So, the result is the titles in the table all have a hyperlink that is something like http://mysite.com/myarticles/123.

4. Now, as this View is a page, it needs a path. From what I've learned from Views, if you use arguments, all your path beginnings must be the same if you linking pages or blocks within one View, otherwise they won't work. What does this mean? It means if you have a path: blah1/blah2/blah3/% then all your other paths would need the first three blah1/blah2/blah3's before the argument appears. The order essentially has to stay consistent. The path for this View page is: myarticles/all.

5. The other page in my View, also needs a path and that path is myarticles/%. What this means is that the node id (my argument) is placed where the % sign is.

That's it! Now when I go to my myarticles/all page and click on a title of an article which is say http://mysite.com/myarticles/123, then the content of node 123 is displayed as a View, meaning it can be as fancied up as you like and doesn't just have to be the raw cck node view.

I hope that helps. There may be other ways to achieve this but this is what works for me.

petelefrank’s picture

Worked well for me. Could not figure it out by myself. Thanks a lot Raj!

mediaslug’s picture

it helped me wrap my head around a similar problem.