Is it possible to construct a completely custom string to use as a field in a View? What I would like to do is take the arguments passed to a Views page, and for each result generated by that View append a URL, built from some of the arguments, which takes users to another page. Essentially I want to pass along the arguments I get in the URL to a detail page.

To be more specific, I have a Calendar-type View, with events generated by a query. Currently the fields I'm using in the calendar are the node title (which links to the node), and the start and end times. What I'd like to do is link to instead of using the node title to link to the actual node, use a custom URL to link to another View, or Panel, containing the node plus some other information.

I don't see any fields which I can include in my calendar that are as customizable as what I need. I suppose I could add a new field to the event content type, but what I really want is for this custom field to generate dynamically when the Views calendar is generated.

I hope that makes sense. Any help would be most appreciated.

Comments

redmonp’s picture

I'll be working on something similar to this and I have a feeling custom code is going to have to be written. I'm planning on creating the view and then embedding the view in a page, and hopefully manipulating the view array to include the changes I need. This would require calling the correct view, grabbing the view array, manipulating it appropriately, and then passing the array back to views for display.

cmillet1’s picture

I'm thinking there may be a solution (at least for my particular problem) with Computed Fields, although I can't quite get that to do what I want yet. What I'm trying to do now is derive a field on the creation of a new node which is a URL pointing to a View which passes that node's ID (via URL arguments) to the View. Essentially that URL attached to the node would be a link to an alternate view of that node (my View). I can use that computed field in my Views Calendar.

I'm having issues pulling the node variables I need using Computed Fields though. It appears to only want to give me access to certain variables, and not the ones I need. Although I just started playing around with the module and maybe I'm doing something wrong. If I figure it out I'll post here.

redmonp’s picture

If I understand you right, you have a View, and when you click on a node in your View, it will take you to a customized view of that particular node?

For example, a calendar with Events. When you click on an Event, it would take you to the node view. If you create a custom Content Type, say Event, you can customize the node view for just that Content Type. Then, you could just filter your View to show only the Event Content Type.

cmillet1’s picture

The problem is that I need to link to a View or Panel, not a Node. The individual nodes listed in the calendar link to nodes. I need to override this behavior so instead of linking to the node (by clicking on the title in the calendar) I link my View or Panel. I need to take advantage of the functionality of Views. So I go from Page A (calendar) to Page B (which is a View doing some complex filtering based on arguments passed from Page A). Page B is useless to me unless it has some contextual information about the last page. For instance, I'm only showing events tagged with 'Tag A' on Page A, and on Page B I still only want to be seeing nodes (of various types) tagged with Tag A.

JennySmith’s picture

I am looking for ideas on how to solve this problem myself -- would you mind sharing your solution?