Redirect url for views with pager

Events happening in the community are now at Drupal community events on www.drupal.org.
heretic381's picture

Hello,

I'm trying to make comments to work with nodes organized in views (need navigation, filtering, etc).

The goal is to prevent comment submit to redirect to original node, but to a page of a view from where the comment was submitted.

The url of views is complex, and I have no idea which expression to put in Rules to get this to work. Redirecting isn't a problem in its self, but I cant find any documentation about complex views url variables.

Thanks in advance.

Comments

Not a Rules issue

itangalo's picture

I don't think this is a Rules issue.

I was trying something similar a few weeks ago, when I had a site displaying comments at node/%node/discussion (using page manager). The approach I tried then, which I think is the "correct" one, was to alter the properties of the comment entities.

The comment entities has a URL property, like comment/1#comment-1, where the first part (comment/1) gets reinterpreted as node/NID. I tried to find a way to alter this, but I didn't get all the way an finally I settled for displaying comments right on the node page.

I think this is the approach you need to have, since every comment also displays a permalink, using this URL. The URL is probably used on a number of other places in Drupal as well.

Good luck. If you find a way to alter how comment/CID should be interpreted, I'd be happy if you write back.
//Johan Falk, Sweden

Thanks for your posting. I

heretic381's picture

Thanks for your posting.
I know that it's not a RULES issue in any way, but I thought that maybe someone could suggest where to find the needed information. I'm sure this could work if I could get the variables expression for dynamic views url. And so submitting comments would just go back to custom view and update the page with the new comment. I've already succeeded with any static url, but the things get complicated when you use pager which creates some nasty paths.

Of course, it's not the only way to achieve what I want (here's my post about that issue on general forum: http://drupal.org/node/1593194), but all the ways I've walked through leads nowhere for the moment.

I don't think that if you redirect the submit form value, anything important change. Comments are still available everywhere. On node page as well as permalink.

I have no clue where to start with the method you suggested? Can you give some more information of what I need. Php? Creating custom modules? Edit template file?

Custom module

itangalo's picture

You'll definitely need a custom module for this, and you'll want to implement something like hook_entity_property_info_alter() or hook_entity_info_alter() or so.

I don't know these grounds too well, so I unfortunately I can't help you scout. :-/

I wish you luck, though!

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: