Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

link in new windows
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4086
Page 1 of 1

Author:  michaeljb [ 5. May 2016, 17:57 ]
Post subject:  link in new windows

Hi there
I am having some trouble getting my links to open in new windows.

I have an iframe on this page http://pictonhh.pecon.ca/hh-search/ if you type hammer in the search box it will display the results, i would like all links from the results page to open in new windows please.

my code is
[advanced_iframe securitykey="6f88488e5cdfdbd92899b4e4d3ffccaace4ca25a" src="http://www.homehardware.ca/en/index.htm" use_shortcode_attributes_only="true" id="example3" height="3050" width="100%" scrolling="no" show_part_of_iframe="true" show_part_of_iframe_x="210" show_part_of_iframe_y="182" show_part_of_iframe_width="541" show_part_of_iframe_height="37" show_part_of_iframe_next_viewports="230,290,1200,3050" show_part_of_iframe_next_viewports_loop="false" enable_lazy_load="true" enable_lazy_load_threshold="200" enable_lazy_load_fadetime="5000" change_iframe_links="#mainContent a" change_iframe_links_target="_blank"]

i have also tried
change_iframe_links=".mainContent a" change_iframe_links_target="_blank"
change_iframe_links="#results.grid a" change_iframe_links_target="_blank"
change_iframe_links=".results.grid a" change_iframe_links_target="_blank"

but i still cannot get the links to open in a new window. Any assistance will be appreciated

thank you

Author:  TinyWebGallery [ 6. May 2016, 08:42 ]
Post subject:  Re: link in new windows

You can only change link targets on a remote domain if you can use the external workaround.

Please see: http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/change-links-targets

Best, Michael

Author:  michaeljb [ 6. May 2016, 12:23 ]
Post subject:  Re: link in new windows

Hi can you give me little more of an idea with the code please.

<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.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe/js/ai_external.js”></script>

And the shortcode which is used is:
[advanced_iframe securitykey="your key" use_shortcode_attributes_only="true" src="http://examples.tinywebgallery.com/example11/example.html" id="advanced_iframe" height="1000" width="900" show_part_of_iframe="true" show_part_of_iframe_x="22" show_part_of_iframe_y="85" show_part_of_iframe_width="187" show_part_of_iframe_height="121" show_part_of_iframe_style="border: 2px solid #ff0000;"]

i can see what is happening in the scrip but the code doesnt reflect this.

could you please let me konw the actual code that i need to add to my page.

thanks

Author:  TinyWebGallery [ 6. May 2016, 13:09 ]
Post subject:  Re: link in new windows

I don't understand what you mean "the code does not reflect this".

Basic question is: Can you add the one line of Javascript to "http://www.homehardware.ca/en/index.htm" ??
<script src=”<your domain>/wp-content/plugins/advanced-iframe/js/ai_external.js”></script>

As I have written before:
"You can only change link targets on a remote domain if you can use the external workaround."

Otherwise it would be possible to change any website you like without having access to it!

Best, Michael

Author:  michaeljb [ 6. May 2016, 14:03 ]
Post subject:  Re: link in new windows

hi michael

i really do not know what you are telling me.

You know what i am trying to achieve here, can it be done yes or no?

If yes, can you just please tell me what i need to do in order to do it as i cannot go any further. I have read the link that you sent me and i do not understand it.

thank you

Author:  michaeljb [ 6. May 2016, 14:07 ]
Post subject:  Re: link in new windows

ok how about another idea then

from my initial search box here http://pictonhh.pecon.ca/hh-search/

is it possible to display the results in a new window showing the original site ( http://www.homehardware.ca/en/index.htm )

thanks

Author:  TinyWebGallery [ 6. May 2016, 14:21 ]
Post subject:  Re: link in new windows

You still have not told tell me if you have access to the other site.

Yes or no?

If not then changing link targets is NOT possible. No one can as this is restricted by the browser.

You can still show the results on your page - but links are than opened inside your iframe.

You can show the results in a new tab if you add target="_blank" to your form.


Best, Michael

Author:  michaeljb [ 6. May 2016, 15:02 ]
Post subject:  Re: link in new windows

sorry, no i do not have access to the other site and i understand what you are telling me.

You can show the results in a new tab if you add target="_blank" to your form.

this will hopefully work, so can you please show me what i put this in the iframe code

[advanced_iframe securitykey="your key" use_shortcode_attributes_only="true" src="http://examples.tinywebgallery.com/example11/example.html" id="advanced_iframe" height="1000" width="900" show_part_of_iframe="true" show_part_of_iframe_x="22" show_part_of_iframe_y="85" show_part_of_iframe_width="187" show_part_of_iframe_height="121" show_part_of_iframe_style="border: 2px solid #ff0000;"]

thank you

Author:  michaeljb [ 6. May 2016, 15:21 ]
Post subject:  Re: link in new windows

sorry this is my code

[advanced_iframe securitykey="6f88488e5cdfdbd92899b4e4d3ffccaace4ca25a" src="http://www.homehardware.ca/en/index.htm" use_shortcode_attributes_only="true" id="example3" height="3050" width="100%" scrolling="no" show_part_of_iframe="true" show_part_of_iframe_x="210" show_part_of_iframe_y="182" show_part_of_iframe_width="541" show_part_of_iframe_height="37" show_part_of_iframe_next_viewports="230,290,1200,3050" show_part_of_iframe_next_viewports_loop="false" enable_lazy_load="true" enable_lazy_load_threshold="200" enable_lazy_load_fadetime="5000" change_iframe_links="#mainContent a" change_iframe_links_target="_blank"]

so where do i need to add target="_blank" in order to make the results open in a new tab

thanks

Author:  TinyWebGallery [ 6. May 2016, 15:43 ]
Post subject:  Re: link in new windows

You cannot change the link target of the search from homehardware. This is not possible!

e.g. http://www.homehardware.ca/en/cat/search/_/N-2pqfZ67l/Ne-67n/Ntk-All_EN?Ntt=hello
searches for hello. So you need to implement your own form with a target=_blank and use Ntt for your search box.
But I don't know where N-2pqfZ67l/Ne-67n/Ntk-All_EN does come from. This can be dynamic also to avoid, that people copy the search ;).

<form id="searchbox" action="http://www.homehardware.ca/en/cat/search/_/N-2pqfZ67l/Ne-67n/Ntk-All_EN" method="get" target="_blank">
<input id="Ntt" type="text" placeholder="Type here">
<input id="submit" type="submit" value="Search">
</form>

See: http://www.w3schools.com/html/html_forms.asp

What you have done so far that you change the viewport after the search is already a good idea. You maybe optimize this. But currently there is not option that you can enable the scrolling for the next viewport. I have added this as a feature for version 8.

Author:  michaeljb [ 6. May 2016, 16:20 ]
Post subject:  Re: link in new windows

i dont understand the form..

where do i put this and what does it need to be called? how does the shortcode work with the form?

Author:  TinyWebGallery [ 6. May 2016, 23:33 ]
Post subject:  Re: link in new windows

You have 2 ways to solve this.

Use you own form -> this has nothing todo with an iframe anymore!

If use an iframe with a different viewport like you have with your shortcode already.
But as you cannot enable scrollbars on a viewport change if the first one has it disabled
you have to make the viewport really big.

Best, Michael

Author:  michaeljb [ 6. May 2016, 23:42 ]
Post subject:  Re: link in new windows

so basically iframe pro cannot do what i want it to do?

display the search box in an ifrae but open the results on the main site in a new window?

Author:  TinyWebGallery [ 7. May 2016, 00:27 ]
Post subject:  Re: link in new windows

Not in your setup as you don't have access to the other page.
But it is simply not possible because of browser restrictions.

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/