Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › result page
This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko 3 months, 4 weeks ago.
- AuthorPosts
- September 25, 2022 at 3:58 am #39466
How to make the result page appear in the iframe instead of jumping?
I can’t find the code location.-
This topic was modified 4 months, 1 week ago by
YUANFAN.
October 3, 2022 at 11:52 am #39479Hi,
I am not sure if this is possible at all. The form had to be submitted to the iframe, but the iframe source also has to be the original page.
Best,
I don’t think this is easily possible without maybe editing the core plugin files.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 3, 2022 at 10:22 pm #39489I uploaded a picture
My iframe is just below the search and I want the result page to appear in the iframeThe settings of the plugin Results Behaviour cannot be implemented, there is only an option to open a new window.
Because I’m not good at coding and don’t know where to start.
Attachments:
You must be logged in to view attached files.October 4, 2022 at 8:31 pm #39512How to code the way to open the jump result page?
I don’t see _blank, where else can I modify it?October 5, 2022 at 8:47 am #39513Please note that custom coding is not actually part of our support. I will try to answer your questions, but I can’t promise anything regarding custom code.
The redirection to the results page (when assigned to a new window) is handled by a function. Maybe if you try to override that, it may actually work:
add_action('wp_footer', 'asp_add_footer_script_2', 9999); function asp_add_footer_script_2() { ?> <script> (function($){ WPD.ajaxsearchpro.helpers.openInNewTab = function(url) { Object.assign(document.createElement('a'), { target: 'iframe1', href: url}).click(); } }(WPD.dom)) </script> <?php }
For this you also have to change the redirection to a new tab: https://i.imgur.com/KrUwaGP.png
However this may not work at all.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
-
This topic was modified 4 months, 1 week ago by
- AuthorPosts
You must be logged in to reply to this topic.