Notifications
Clear all

Script [Closed] Topic Shortcode redirecting question

8 Posts
2 Users
2 Reactions
1,025 Views
Posts: 5
Topic starter
(@nolan59)
Active Member
Joined: 10 months ago

First post here so hi 😀Β 

I am busy converting my site to work on WPForo from SMF, so lot's of work ahead lol, but enjoying WPForo so far.

I have added this shortcode to a page : [wpforo item="topic" id="4"]

All is great, the topic shows on the page along with existing replies andΒ  the editor to add a reply.

When you reply to the topic you are however returned to the topic on the Forum and now the page you replied on.

Is there a way to return the member back to the original page instead of bumping them back to the forum each time?

Thanks for the advice in advance.

7 Replies
Posts: 5
Topic starter
(@nolan59)
Active Member
Joined: 10 months ago

Seems like I am the only one adding a topic to an external page 😪Β 

Robert
Posts: 10520
Admin
(@robert)
Support Team
Joined: 8 years ago

Posted by: @nolan59

When you reply to the topic you are however returned to the topic on the Forum and now the page you replied on.

Is there a way to return the member back to the original page instead of bumping them back to the forum each time?

Hi @nolan59,

Please read this topic, the shortcode pages are not a standalone forum pages, the shortcodes are only designed to display a certain topic not to create a separate forum: https://wpforo.com/community/postid/43746/

Posts: 5
Topic starter
(@nolan59)
Active Member
Joined: 10 months ago

Thank you for the reply Robert. I appreciate the help. 😀Β 

That's odd as embed topic shortcode also shows the user a reply box so you would think that the embedded topic would return the user back to the same page after a reply.

Do you think I could achieve that by using the

  • 'wpforo_after_add_post' - args: (array)$post, (array)$topic

hook?

1 Reply
Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10520

@nolan59,

The whole forum system is connected to the one root path /community/ or whatever you've changed it. This is like a tree, it can only have one root, there is no way to create root for each branch of the tree, you can display branches in different frames (pages) but you cannot cut it from the tree. So there is no way to have stand-alone working topic page.Β 

You can create a new tree (board) with its own root in a separate page. But this will be a fully separate forum with it's categories and topics.

Posts: 5
Topic starter
(@nolan59)
Active Member
Joined: 10 months ago

actually there is an easy way for it to work like this and all it will take is adding one or two lines of code to do it.

When the reply form is sent, Wordpress adds a hidden field called "_wp_http_referer" which contains the current page url. Wordpress uses this to do security checks.

The WPForo shortcode could also read this hidden field and use it to direct the user back to the page they were on instead of the forum topic as it currently does.

If there is anybody that knows the code and can point me to the file that processes the form, I could add the redirect into my forum's file.

Page 1 / 2