Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to break out of iframe in an embedded forum upon sign in or sign out?
an2050
New
Vanilla 2.0.18.10, embedded in WordPress 3.8 with the Vanilla Forums Integration plugin for comments.
Perhaps I'm searching wrong, but couldn't find a discussion. After I sign-out of the embedded sign-out page, I use a Target of ../ to get back to the homepage of the WP. Instead, it loads the WP homepage in the iframe, so the WP homepage is embedded in the WP page. Is there a way to get get the target to load as _top after a sign-out?
This doesn't apply (I believe) as this is not a link but a page loaded after signing out: http://vanillaforums.org/discussion/25717/change-target-on-links-in-embed-forum
Trying to place an attr on Target_Form had no effect.
Tagged:
0
Comments
@an2050
I know what you mean , when I click home link(to my main site) without target blank, from the embedded forum I have in wordpress it opens in the frame too. The only way to not do that is to use target blank.
Depending on where it is in your menu
$('#Menu li:first > a').attr('target', '_blank');
However you can also try and it will open in the parent window. In other words the main window. Which is what you want I think...you would use this jquery the same as the info from the link you posted.
$('#Menu li:first > a').attr('target', '_parent');
If this does not work, then maybe you should change the redirect to the wordpress main page after logout. It should technically redirect back to the discussions page. Which is the home page you choose in the dashboard or Routes.
If you added a home link in the menu that goes to your root, just add target="_parent"
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
In class.entrycontroller.php is the code to Route the user to the home page / after sign in or log out or registration , if there is no Route set. It goes to the default controller . Which is discussions by default.
Maybe this can be handled via htaccess but I am unsure how to go about it.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
try the wp noframes wordpress plugin on the wordpress site.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@vrijvlinder Thanks for the info. I didn't try routes but I did try the targets in that jquery (which work for links that are clicked). But this is a redirection after a sign-out or sign-in. It redirects to a route or a page, but how would you specify a target for a redirect, namely _parent or _top? Don't know where exactly Vanilla redirects after a signout. I'd want it to redirect to the WP homepage, on _top versus in the iframe.
Thanks.... I had that plugin installed for a previous problem and while that does work, it is slow and doesn't work for non-WP pages and flashes the embedded WP in a WP page before breaking out of the frame, so was looking for something more seamless.
you are only ever goign to be able to to do this is JavaScript.
http://usablelayout.com/articles/automatically-break-out-iframe
the speed is dependent on on when it loads. You would wan it to detect as soon as possible.
Personally I would avoid embedding your forum. It might be a bit more work to to theme your forum, but it is worth it.
grep is your friend.
I can think of some red herring...You could possibly clone the class.entrycontroller.php and put it in your theme folder in the views and edit all the redirects to / to be the full url of where you want them to go.
The thing about routes is that you can't use an external url as far as I know.
The redirect happens in the entrycontroller it is not a link it is an internal route.
/forum or / should be the forum root or home. This can be set in the htaccess file for the forum.
What you would need to be able to do is reroute the redirect. I am not sure how that can be possible
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌