Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7488581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:59:41+00:00 2026-05-29T14:59:41+00:00

Goal : I have a view which displays multiple nodes in full view including

  • 0

Goal :

I have a view which displays multiple nodes in full view including the comments. I want to redirect the users who comment using my view back to the view and not to the article.

At the same time if the user comments on the node and does NOT use MY VIEW they should not be redirected. In other words the redirect to be used only on my view.

My below code works well but unfortunately all the the sites comments form start to redirect. I only want to redirect users who are using my panel view on the path /newvc to get redirected.

My code:

function customchatter_form_comment_form_alter(&$form, &$form_state, $form_id){

$form['#submit'][] = 'submitForm';
}

function submitForm($form, &$form_state) {
$form_state['redirect'] = 'newvc'; // need to redirect
}

My logical problem:

I can’t seem to get the logic which will allow me to isolate comments coming from my view.

I tried to use the below code but it did not work as all the comments even the ones in my view follow the same path logic.

$url_components = explode('/', request_uri());


if ($url_components[1]=='comment' && $url_components[2]=='reply') {
// no use as this still targets all the comments.
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T14:59:42+00:00Added an answer on May 29, 2026 at 2:59 pm

    I solved it by using the below code. $_POST[‘submissionpath’] holds the path to the original page.

    function submitForm($form, &$form_state) {
    
    print $form;
    $form_state['redirect'] =$_POST['submissionpath'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: var GoalPanelView = Backbone.View.extend({ // Bind to the goal
goal: I have the string 1234432144 I want to only replace the first 2
I have a view and a loop within which a partial view is rendered.
As you can see, I have this PlayLesson_01 activity which displays images and audio
Final goal: Have a few java objects sharing the same base class persisted into
Let me first describe my goal: I have created an object with 3 properties:
The goal is to have the member variable _AddValue point to the CreateFirstValue function
My goal is to have an Android phone (Samsung Galaxy Nexus) communicate with a
My goal is to have the url routing as following: http://www.abc.com/this-is-peter-page http://www.abc.com/this-is-john-page What is
My goal is to have a jQuery datepicker pop up when the user clicks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.