You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, July 19th 2013, 12:51pm

Hyperlinks to external websites

How do I add an external hyperlink to a hotspot?

I've figured out how to open the Editor plugin and created a 'hotspot' in my panorama but don't know the code to add to the XML file to make it an active link. I want it to link to an external URL.

Is this possible, and if so, how?

Many thanks

A

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Friday, July 19th 2013, 4:18pm

Hi, I think, openurl(); action should do it.

Read documentation on it here:

http://www.krpano.com/docu/actions/#openurl
Regards,

Alexey

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

3

Friday, July 19th 2013, 4:45pm

Source code

1
2
3
4
5
<hotspot name="your_hotspot_name".
.
. 
onclick="openurl(http://www.google.com/,_blank)"
</hotspot>


If you want to open in in new window. For other details follow the documentation link already provided to you by Alexey.

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

4

Friday, July 19th 2013, 9:09pm

Umalo, I'm afraid url needs those tricky single quotation marks before and after the url, if I remember it correctly from the documentation examples...

Smth like this:

Source code

1
openurl('http://yourwebsite.html');


I'm still quite often puzzled where to put this quotations and where not to...

For example, in the txtadd(); function:

Source code

1
txtadd(new_variable, 'get(old_variable)','_addition');


or will it work this way:

Source code

1
 txtadd(new_variable, get(old_variable),'_addition'); 


*rolleyes* or both are quite right?
Regards,

Alexey

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

5

Friday, July 19th 2013, 9:21pm

No you don't need quotes on openurl. I have never ever used it there.

For other questions: I don't use them when I have numerics which are added to some text
Shoot and try ;-)

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

6

Friday, July 19th 2013, 9:26pm

Okay, that's clear now *tongue* Thanks a lot!
Regards,

Alexey

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

7

Friday, July 19th 2013, 9:47pm

But now when I think twice, there must be a reason why it is stated in documentation the openurl with single quote.
I don't think I have project where I put them up to now. Tested on many devices and works fine.

P.S. I'm sure Klaus will give his statement here. I just hope I will not need to update all projects after that ;(

8

Monday, July 22nd 2013, 1:28pm

Hyperlinks to external websites

Hi

I've tried with and without single quotes (see below) but neither work. Am I missing something really obvious? I've tried with and without Editor open on the pano. Any ideas?

<hotspot name="hs1" onclick="openurl('http://www.google.com/,_blank')">
<point ath="0.080250" atv="0.023000" />
<point ath="0.094000" atv="0.023000" />
<point ath="0.094000" atv="0.028250" />
<point ath="0.080250" atv="0.028250" />
</hotspot>

and

<hotspot name="hs1" onclick="openurl(http://www.google.com/,_blank)">
<point ath="0.080250" atv="0.023000" />
<point ath="0.094000" atv="0.023000" />
<point ath="0.094000" atv="0.028250" />
<point ath="0.080250" atv="0.028250" />
</hotspot>

Thanks


A

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

9

Monday, July 22nd 2013, 1:34pm

I don't see semicolon (;) in your code after the final bracket:

It should be:

Source code

1
<hotspot name="hs1" onclick="openurl('http://www.google.com/,_blank');">
Regards,

Alexey

10

Monday, July 22nd 2013, 2:42pm

Hyperlinks to external websites

Hi Alexey

Thanks for that but still no success! When I open the pano in Internet Explorer all looks OK. The hotspot appears as I hover mouse over hotspot (cursor changes to hand) but nothing happens when I click. Flash security settings are OK so that shouldn't block. Here is the code as it appears now:

<hotspot name="hs1" onclick="openurl('http://www.google.com/,_blank');"> <point ath="0.080250" atv="0.023000" />
<point ath="0.094000" atv="0.023000" />
<point ath="0.094000" atv="0.028250" />
<point ath="0.080250" atv="0.028250" />
</hotspot>

Is it in the right place, between <hotspot> and <hotspot/> markers?

Thanks

A

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

11

Monday, July 22nd 2013, 3:19pm

Hi, in your code the single quotation mark stands after the " _blank" parameter, it must be located before it

Just tested the following code and it works fine:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<hotspot name="hs_test"  onclick="openurl('http://www.google.com/',_blank);"> 
		<point ath="0.1" atv="2.0" />
		<point ath="0.1" atv="2.0" />
		<point ath="1.2" atv="1.1" />
		<point ath="3.9" atv="1.2" />
		<point ath="6.9" atv="2.5" />
		<point ath="7.1" atv="6.3" />
		<point ath="3.3" atv="7.8" />
		<point ath="-3.0" atv="7.4" />
		<point ath="-4.6" atv="2.3" />
		<point ath="1.2" atv="1.1" />
	</hotspot>
Regards,

Alexey

12

Monday, July 22nd 2013, 4:07pm

Hyperlinks to external websites

Hi Alexey

Yay! It works when I publish to view on internet but not when I preview locally - that's not a problem.

I'm so grateful for your help - it is much appreciated.

Thanks

A

13

Thursday, July 25th 2013, 7:51pm

Hi everyone...
I too have an issue. Here is my code generate by a php script:

spot1 works perfectly because it is linked to an internal scene
spot2 for now just points to google but would in actual fact point to another related link on my website.

Online Example:
http://home.govisit.co.za/viewer/?s=10 look towards the rocks away from the house. the arrow on top of the rock is suppose to load an different virtual tour on the rocks.


It simply does not work I'm using krpano 1.6.3. Any ideas would be appreciated. I have tested it on my local webserver and online webserver and both have the same issue.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<krpano version="1.16" title="Title" onstart="startup();">
	<include url="skin/vtourskin.xml" />
	<skin_settings bingmaps="true"
	               bingmaps_key=""
	               bingmaps_zoombuttons="true"
	               gyro="true"
	               thumbs_width="120" thumbs_height="80" thumbs_padding="10" thumbs_crop="0|40|240|160"
	               thumbs_opened="true"
	               thumbs_text="true"
	               thumbs_dragging="true"
	               thumbs_onhoverscrolling="false"
	               thumbs_scrollbuttons="false"
	               thumbs_scrollindicator="false"
	               tooltips_thumbs="true"
	               tooltips_hotspots="true"
	               tooltips_mapspots="true"
	               controlbar_offset="20"
	               />

	<!-- set optional skin logo url -->
	<layer name="skin_logo" url="" scale="0.25" opened_onclick="openurl('...',_blank);" />


    
        
        <scene name="scene_0010" title="10:Front of house - Beach Road" onstart="" thumburl="../scene/0010/thumb.jpg" lat="-34.3438620" lng="19.0339970" heading="0">
    
            <view hlookat="0" hlookatmin="0" hlookatmax="360" vlookat="0" vlookatmin="-90" vlookatmax="90" fovtype="MFOV" fov="120" maxpixelzoom="1.25" fovmin="70" fovmax="140" limitview="AUTO" />
    
            <preview url="../scene/0010/preview.jpg" />
    
            <image type="CUBE" multires="1" tilesize="512" progressive="">
            
                <level tiledimagewidth="3820" tiledimageheight="3820">
                    <cube url="../scene/0010/l4_%s_%v_%h.jpg" />
                </level>
                <level tiledimagewidth="1910" tiledimageheight="1910">
                    <cube url="../scene/0010/l3_%s_%v_%h.jpg" />
                </level>
                <level tiledimagewidth="955" tiledimageheight="955">
                    <cube url="../scene/0010/l2_%s_%v_%h.jpg" />
                </level>
                <level tiledimagewidth="512" tiledimageheight="512">
                    <cube url="../scene/0010/l1_%s_%v_%h.jpg" />
                </level>

                <mobile>
                    <cube url="../scene/0010/mobile_%s.jpg" />
                </mobile>
            </image>
			<hotspot name="spot1" style="skin_hotspotstyle" ath="166.638" atv="1.166" onclick="'openurl('http://www.google.com/',_blank);" />
			<hotspot name="spot2" style="skin_hotspotstyle" ath="9.730" atv="-1.187" linkedscene="scene_0002" />
        </scene>
<action name="startup">
		if(startscene === null, copy(startscene,scene[0].name));
		loadscene(get(startscene), null, MERGE);
	</action>


</krpano>
Rudolph Thomas
TIGME.COM / GoVisit.net

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

14

Thursday, July 25th 2013, 8:30pm

No, you add the onclick quite right, but you have style="skin_hotspotstyle" defined also which also has onclick parameters, and any style ALWAYS overrides the same parameters indicated inside a hotspot. So to add onclick event to this very hotspot either delete "style="skin_hotspotstyle" and transfer all parameters from it into the hotspot. Or copy the style code, paste it, rename it as "skin_hotspotstyle_2" and change the onclick parameter to what you need. And in this case don't forget to state "style="skin_hotspotstyle_2". The "skin_hotspotstyle" can be found inside the standard "vtourskin" xml generated by the droplets.

Hope this helps *tongue*
Regards,

Alexey

15

Thursday, July 25th 2013, 9:01pm

No, you add the onclick quite right, but you have style="skin_hotspotstyle" defined also which also has onclick parameters, and any style ALWAYS overrides the same parameters indicated inside a hotspot. So to add onclick event to this very hotspot either delete "style="skin_hotspotstyle" and transfer all parameters from it into the hotspot. Or copy the style code, paste it, rename it as "skin_hotspotstyle_2" and change the onclick parameter to what you need. And in this case don't forget to state "style="skin_hotspotstyle_2". The "skin_hotspotstyle" can be found inside the standard "vtourskin" xml generated by the droplets.

Hope this helps *tongue*
Hi Alexey

Thanks, I'll give it a try tomorrow. Been at it all day long between various PHP files never thought of opening the skin.xml file to hunt for the problem. Big Thanks! *thumbup*
Rudolph Thomas
TIGME.COM / GoVisit.net

16

Thursday, July 25th 2013, 9:20pm

No, you add the onclick quite right, but you have style="skin_hotspotstyle" defined also which also has onclick parameters, and any style ALWAYS overrides the same parameters indicated inside a hotspot. So to add onclick event to this very hotspot either delete "style="skin_hotspotstyle" and transfer all parameters from it into the hotspot. Or copy the style code, paste it, rename it as "skin_hotspotstyle_2" and change the onclick parameter to what you need. And in this case don't forget to state "style="skin_hotspotstyle_2". The "skin_hotspotstyle" can be found inside the standard "vtourskin" xml generated by the droplets.

Hope this helps *tongue*
Hi Alexey

Thanks, I'll give it a try tomorrow. Been at it all day long between various PHP files never thought of opening the skin.xml file to hunt for the problem. Big Thanks! *thumbup*
OK OK I could not wait till tomorrow. Added a simple hotspot just for testing and now it is working perfectly. Completely MySQL driven virtual tour system in the making.

Thanks Alexey. You made my day *thumbsup*
Rudolph Thomas
TIGME.COM / GoVisit.net

17

Thursday, August 15th 2013, 8:36am

hotspot hyperlink

Having similar problem. Hotspot works locally but when uploaded to FTP site the hotspot does not show and the tour freezes up. It is so frustrating when you get everything working locally then transfer to online and it all craps out. Any help is appreciated. Thanks,




<!-- place your scene hotspots here -->
<hotspot name="spot1" style="skin_hotspotstyle" ath="102.288" atv="-6.519" linkedscene="scene_c_(09)" />

<hotspot name="link1"
type="image"
url="http://www.relprocessing.com/storage/Info.png?__SQUARESPACE_CACHEVERSION=1341086388560"
alturl="..."
keep="false"
devices="all"
visible="true"
enabled="true"
handcursor="true"
maskchildren="false"
zorder="1"
style=""
ath="15.627" atv="-16.344"
edge="center"
zoom="false"
distorted="false" rx="0.0" ry="0.0" rz="0.0"
width="50" height="50"
scale="1.0"
rotate="0.0"
alpha="1.0"
onover=""
onhover=""
onout=""
onclick="openurl('http://www.dickslastresort.com/',_self);"
ondown=""
onup=""
onloaded=""
/>