How to have hotspot load page and not switch #container

Q&A about the latest versions
Post Reply
LondonLight.org
Posts: 41
Joined: Thu May 16, 2013 11:18 am

I know the subject line is unclear, so let me explain:
I'm coding a ZenPhoto theme to display photos and panoramas. Since a pano is either SWF or a collection of files and folders, some trickery is involved. I will skip the alternative ways and just explain the best one. Each panorama has a JPEG image, say kitchen.jpg. Alongside this I need to put another file, kitchen.xml. Now ZenPhoto picks this up as a textObject and using PHP I end up with an album page that uses the JPEG images as thumbnails, but when I click on the thumbnail the pano.php page (based on the HTML file generated by Pano2VR) loads the panorama using the xml file from Pano2VR, kitchen.xml.

Here's the problem: when I load a pano from the album, everything goes well: pano.php shows the panorama and alongside it I put a div with the description, and above it the name. However, when I click on a polygon hotspot (the door in the kitchen, which leads to foyer.xml), no matter how I craft the URL of the hotspot, your javascript just switches the content of the #container div with this new pano. That's bad for me, because the page still shows the name and description of the kitchen, not the foyer. How do I force clicking a hotspot to load the panorama as a whole page and not just switch the contents of the #container?
User avatar
JimWatters
Posts: 329
Joined: Thu Oct 07, 2010 6:16 pm
Location: Saint John, New Brunswick
Contact:

Update your description to have information the entire tour, not just the first pano. Allow information about pano to be displayed inside the pano.
LondonLight.org
Posts: 41
Joined: Thu May 16, 2013 11:18 am

Thank you for taking the time to answer but your answer is off-topic. The user should be able to decide whether he wants the contents of the #container to be switched on the fly, or whether the whole page should be loaded.
LondonLight.org
Posts: 41
Joined: Thu May 16, 2013 11:18 am

I spent many hours yesterday fighting with getting two systems (ZenPhoto gallery software and pano2vr_player.js) playing nicely together because of this problem (not enough power given to the user), so it would be really neat if we could force clicking a hotspot to load the URL as a page and not just to switch XMLs!

I would like to have this structure because it's clean and easy to manage:
Image
All skin files and javascript files are external, re-used, for quick retrieval from the cache of the person browsing my site.

Here's what the situation looks like so far (I'm still trying to get a clean and usable solution):
- ZenPhoto's mode for handling non-image file works by having an image file and a text file with the same filename but different next to each other, e.g. kitchen.jpg and kitchen.txt. They are then identified as being special and I get the power how to control them. It seems to only support two files. If I try three file - kitchen.jpg, kitchen.txt and kitchen.xml, that doesn't work.
- Pano2VR has to have the XML file with an XML extension. If I rename kitchen.xml to kitchen.txt and set pano.readConfigUrl("kitchen.txt"); it won't load in the pano player. Pity, that might solve my problems if it did.
- I don't want to use absolute paths in the hotspots because that means if I want to later rename the album with panoramas, I'd have to edit every panorama's xml file to change the absolute path in each hotspot.
- I can't point hotspots to xml files because then the #container div is replaced instead of telling ZenPhoto to load the page. Also, the hotspot path is relative to the xml of the current pano, which as you can see in the screenshot above is inside the "tour" folder, not in the same place as the jpg/txt, and if I put the xml files together with the jpg/txt files then ZenPhoto stops playing along :)
User avatar
360Texas
Moderator
Posts: 3684
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

I suspect you are well past the point of asking your questions in the ZenPhoto forum: http://www.zenphoto.org/support/

ZenPhoto company background: Zenphoto is the ideal CMS for personal websites of illustrators, artists, designers, photographers, film makers and musicians.
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com
LondonLight.org
Posts: 41
Joined: Thu May 16, 2013 11:18 am

I ask the ZenPhoto questions in the ZenPhoto forum, and the Pano2VR questions here. Having the Pano2VR javascript allow me to load a hotspot as a normal URL and not to switch the XML for the #container on-the-fly is not ZenPhoto's problem.
Don
Posts: 143
Joined: Thu Mar 07, 2013 2:59 pm
Location: Southern California

LondonLight.org wrote:How do I force clicking a hotspot to load the panorama as a whole page and not just switch the contents of the #container?
Sounds like you are creating a "Tour" with many nodes inside a single pano2vr file. And rightly so, that is the way pano2vr works best. However, to achieve what you are asking, then maybe instead go back to the old* way of creating one pano per output folder. Then utilize the hotspot onclick action >> Go To Url to load the web address of the desired node...and the target would be "_self". That would force the next node to load in the current window, and the web address would change as you wish.

*It's not really the "old" way. I still do it this way many, many times as the situation requires.
Last edited by Don on Sun Jun 29, 2014 3:12 am, edited 1 time in total.
Don
Posts: 143
Joined: Thu Mar 07, 2013 2:59 pm
Location: Southern California

LondonLight.org wrote:- Pano2VR has to have the XML file with an XML extension. If I rename kitchen.xml to kitchen.txt and set pano.readConfigUrl("kitchen.txt"); it won't load in the pano player. Pity, that might solve my problems if it did...
Seems like you are only choosing to output Flash. Try outputting html5 and embed the xml, then the external xml file is not necessary.
LondonLight.org
Posts: 41
Joined: Thu May 16, 2013 11:18 am

Hi Don

I'm outputting only HTML5.
Each .pano2vr file corresponds to only one panorama (I don't think more is possible with the 69,00€ version).

"onclick action >> Go To Url to load the web address" sounds like what I need. How do you do that? I have it like so: http://i.imgur.com/LLw2op7.jpg
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
With each p2vr project file you would need to output an HTML page.
Each page would have your projects name, example pano_one.html.

Open the hotspot editor and in the URL field enter: pano_two.html, etc and in the target enter: _self.

The options for the target field are _self and _blank, for same window and new window.

Looking at your website, I see that when I zoom in and out you are getting cube faces reloading. To avoid this select Load at Startup for the lowest level in the HTML5 multi resolution tab.

Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
LondonLight.org
Posts: 41
Joined: Thu May 16, 2013 11:18 am

That solution is not possible when using gallery software where there is a single image-viewing PHP page.

I laid out the situation above, and this is how I handled it:
- I named the ZenPhoto page that manages showing albums album-pano.php and the one that handles Pano2VR panoramic images image-pano2vr.php
- There is a text file for every panorama, e.g. Kitchen.txt, Bedroom.txt, etc. They are empty, they are only there to tell ZenPhoto that I want to do something special using those names.
- I store the XML for each panorama along with a JPEG thumbnail and the TXT file. I could also store a custom skin.js for each of them, e.g. Kitchen.js, but I have no need to, so I re-use the same skin.js for all - save overhead.
- I store pano2vr_player.js and skin.js and the skin images in the website root /pano2vr/
- Each pano hotspot links to a TXT file, so e.g. Kitchen.txt links to Bedroom.txt, this lets me have the panoramas relative to themselves so I can rename albums without breaking links. I cannot link to the XML files because then pano2vr_player.js just switches the contents of #container which sucks because the breadcrumb and description divs don't change.
- The problem is that ZenPhoto uses "friendly" URLs which invoke the whole ZenPhoto mechanism e.g. londonlight.org/zp/Real-Estate/House%20of%20Karin/Kitchen.txt , but if I use the full unprotected URL, e.g. londonlight.org/zp/albums/Real-Estate/House%20of%20Karin/Kitchen.txt then I open the file directly bypassing ZenPhoto. Linking the hotspot to "Kitchen.txt" invokes the unprotected URL which means that the TXT file would open as a TXT file instead of invoking the ZenPhoto mechanism, so I don't see the panorama, I see a text file. To solve this I used .htaccess to remove "albums/" from the URL if the URL ends with ".txt"

It was not easy :)

Thank you for the load-at-startup tip!
Post Reply