Sie sind nicht angemeldet.

1

Mittwoch, 8. Februar 2017, 14:45

Pulling External XML Data

Is it possible to have krpano pull an XML data file and plug that data into various parts of the tour? For example, if I have an xml file titled contact.xml that has an email address, phone number and website. Then in the tour.html file of the virtual tour, I have js functions like this:

function openWebpage(){
window.open('[WEBSITE]');
}

function sendEmail(){
window.location.href = "mailto:[EMAIL]?subject=Request For More Information";
}

function openPhone(){
window.location.href = "tel:[PHONE]";
}[/email]

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Donnerstag, 9. Februar 2017, 13:51

This can be done in many ways.

1.email

krpano code

Quellcode

1
2
3
<action name="send_email">	
  js(sendEmail('email@dom.com','Request For More Information'));
</action>

Javascript code
function sendEmail(email,info){
window.location.href = "mailto:"+email+"?subject="+info;
}

2.webside


krpano code

Quellcode

1
2
3
<action name="open_www">	
js(openWebpage('http://www.krpano.com'));
</action>

Javascript code
function openWebpage(www){
window.open(www);
}


3. tel

krpano code

Quellcode

1
2
3
<action name="open_tel">	
js(openPhone('123456789'));
</action>

Javascript code
function openPhone(num){
window.location.href = "tel:"+num;
}


These examples are based on your code but it can be done differently directly in krpano xml code.

reed this:
js actions
js in the xml

example:


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<action name="open_tel">    
openurl(tel:1123456,_self);  
</action>  
<action name="send_email">    
openurl(mailto:?subject=Subject,_self);  
</action>
  
<action name="open_www" type="Javascript"><![CDATA[    
var link = "https://www.krpano.com";    
var left = (screen.width - 600) / 2;    
var top = (screen.height - 600) / 2;    
var params = "menubar=no,toolbar=no,status=no,width=600,height=600,top=" + top + ",left=" + left;    
window.open(link,'sharer', params);  
]]></action>


Piotr



Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*