Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum https://www.tinywebgallery.com/forum/ |
|
Redirect frame pages to main page with the frame embedded https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4303 |
Page 1 of 2 |
Author: | xega [ 4. Apr 2017, 20:51 ] |
Post subject: | Redirect frame pages to main page with the frame embedded |
Hi! I'm having a bit of an issue. My site (http://www.hafdal.dk/legstadaleit/) is starting to pop up in Google searches, but the problem is that the link that people are getting sent to is the content of the iframe and that is not embedded into the site like I want it to. An example is: The page displayed correctly: http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=www.hafdal.dk%2Ftng%2Fgetperson.php%3FpersonID%3DI4259%26tree%3DTree2 The iframe displayed on its own (which I do NOT want): http://www.hafdal.dk/tng/getperson.php?personID=I4259&tree=Tree2 Any idea how I can fix this? |
Author: | TinyWebGallery [ 7. Apr 2017, 10:18 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
You need to use the external workaround script. Then you can configure that if the page is opened directly it is redirected to the main page. You find this on the "external workaround" tab. See: http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/change-links-targets#e11 var iframe_redirect_url = "http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo"; Best, Michael |
Author: | xega [ 15. Apr 2017, 22:16 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
Hi again. My WP domain is: http://www.hafdal.dk/legstadaleit/ And my iframe domain is: https://www.hafdal.dk/tng/ Do I have to add the script like it says in Example 11 or is Example 10 enough for me? Thanks! |
Author: | TinyWebGallery [ 16. Apr 2017, 08:49 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
You need 11 because in ai_external.js is the code for the redirect. Best Michael |
Author: | xega [ 16. Apr 2017, 18:39 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
My current code looks like this: Code: [advanced_iframe securitykey="xxxx" use_shortcode_attributes_only="true" src="http://www.hafdal.dk/tng/cemeteries.php" id="legstadaleit" height="800" width="100%" map_parameter_to_url="page" add_iframe_url_as_param="same" onload_resize="true"] And the script looks like this: Code: <script> var iframe_redirect_url = "http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo"; var change_iframe_links = "#iframe-navigation a"; var change_iframe_links_target = "_blank"; </script> <script src=”http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js”></script> But what should be in the script instead of "http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo"? And is that the only change I have to make before adding it to a page? |
Author: | TinyWebGallery [ 18. Apr 2017, 15:40 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
For your setup you only need. [advanced_iframe securitykey="xxxx" use_shortcode_attributes_only="true" src="http://www.hafdal.dk/tng/cemeteries.php" id="legstadaleit" height="800" width="100%" onload_resize="true"] <script> var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=www.hafdal.dk%2Ftng%2Fgetperson.php%3FpersonID%3DI4259%26tree%3DTree2"; </script> <script src=”http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js”></script> var iframe_redirect_url is your parent url! Best, Michael |
Author: | xega [ 18. Apr 2017, 16:17 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
Thank you very much Michael. I only have one last question (I hope), what file to I place the script in? |
Author: | TinyWebGallery [ 18. Apr 2017, 16:47 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
http://www.hafdal.dk/tng/getperson.php So normally a footer file which is included everywhere... Best, Michael |
Author: | xega [ 19. Apr 2017, 18:08 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
Hi Michael I have now added: Code: <script> var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is"; </script> <script src=”http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js”></script> To my www.hafdal.dk/tng/footer.php file I have also added the following to my WP page: Code: [advanced_iframe securitykey="xxxxxx" use_shortcode_attributes_only="true" src="http://www.hafdal.dk/tng/cemeteries.php" id="legstadaleit" height="800" width="100%" onload_resize="true"] But going to f.ex. http://www.hafdal.dk/tng/showmedia.php?mediaID=2509&medialinkID=5056 does not redirect to http://www.hafdal.dk/legstadaleit/database/?page=www.hafdal.dk%2Ftng%2Fshowmedia.php%3FmediaID%3D2509%26medialinkID%3D5056 What am I doing wrong? |
Author: | TinyWebGallery [ 19. Apr 2017, 23:11 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
<script src=”http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js”></script> gives me a 404! so this you should fix first! you use ” and not " !! And why should it redirect to http://www.hafdal.dk/legstadaleit/database/?page=www.hafdal.dk%2Ftng%2Fshowmedia.php%3FmediaID%3D2509%26medialinkID%3D5056 if you set var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is"; ? Best, Michael |
Author: | xega [ 20. Apr 2017, 17:07 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
My code is now: Code: <script> var iframe_redirect_url = ”http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is”; </script> <script src=”http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js”></script> I didn't notice that I had the wrong type of ", I just switched to Linux and my keyboard layout must be different. The second part you write: Quote: And why should it redirect to http://www.hafdal.dk/legstadaleit/database/?page=www.hafdal.dk%2Ftng%2Fshowmedia.php%3FmediaID%3D2509%26medialinkID%3D5056 if you set var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is"; I don't quite understand what it should be instead of http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is - should it not be the basic url? |
Author: | TinyWebGallery [ 20. Apr 2017, 17:43 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
you still use ” you need to use normal " and you need to put in the url of the parent. the page where you want to redirect to. press f12 to see the Javascript errors ai_external.js%E2%80%9D Failed to load resource: the server responded with a status of 404 (Not Found) |
Author: | xega [ 20. Apr 2017, 18:01 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
I think I have it correct now, I can't see any errors at least. Quote: and you need to put in the url of the parent. the page where you want to redirect to. But the problem is I want to redirect to different pages, I want to redirect all the pages in www.hafdal.dk/tng to open to in the iframe in www.hafdal.dk/legstadaleit. Maybe I have misunderstood what is possible? For example: This page: http://www.hafdal.dk/tng/getperson.php?personID=I4042&tree=Tree2 Should be redirected to this page: http://www.hafdal.dk/legstadaleit/database/?lang=is&page=www.hafdal.dk%2Ftng%2Fgetperson.php%3FpersonID%3DI4042%26tree%3DTree2 |
Author: | TinyWebGallery [ 20. Apr 2017, 22:19 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
Then you define the var iframe_redirect_url at each file and the ai_external in the footer.php. Best, Michael |
Author: | xega [ 20. Apr 2017, 22:28 ] |
Post subject: | Re: Redirect frame pages to main page with the frame embedde |
That is not possible If I just want to redirect to http://www.hafdal.dk/legstadaleit/?lang=is, which is the frontpage of my website, is it then enough to have this script in the footer: Code: <script> var iframe_redirect_url = ”http://www.hafdal.dk/legstadaleit/?lang=is”; </script> <script src="http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js"></script> So going to this page: http://www.hafdal.dk/tng/getperson.php?personID=I4042&tree=Tree2 will send me to http://www.hafdal.dk/legstadaleit/?lang=is. Best regards Rakel |
Page 1 of 2 | All times are UTC + 1 hour [ DST ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |