Viewer setup with rootPath

CSS styling, controls, custom look and feel, custom packaging and deployment.
brian_guess
Posts: 4
Joined: Fri Sep 14, 2012 11:16 am
Contact:

Viewer setup with rootPath

Postby brian_guess » Fri Sep 14, 2012 11:23 am

I'm a PRO customer and we want to keep all our images on our cdn. Looks like the rootPath setting is what we need.

Is there a guide or sample that shows how rootPath is configured?

WebSupport
Posts: 1105
Joined: Thu Aug 23, 2012 11:35 am
Location: Pasadena, CA
Contact:

Re: Viewer setup with rootPath

Postby WebSupport » Fri Sep 14, 2012 4:03 pm

Hi Brian, here's what we have for rootPath in our user guide:

This optional setting can be used to specify alternative location of viewer assets (images, hot-spot rollover images, etc) that are configured in xml and passed via configFileURL. When this settings is specified, the viewer will first load the xml configuration specified in configFileURL and will then append the rootPath to any path specified in the xml file. This is valuable when you need to store image assets on dedicated file servers or CDN locations.


Here's how this would apply to the CDN scenrio:

Server 1:
- product pages.
- imagerotator scripts / css.
- viewer config xml for each product as generated by SpotEditor (with a relative path for all referenced images).

Server 2:
- folders with images / hot-spots for each product.

So you would have something like this on your product page on server 1:

_imageRotator.settings.configFileURL = "/360-xmls/product1_config.xml";
_imageRotator.settings.rootPath = "http://server2/360-assets/product1"; // product1 is a folder with images.
_imageRotator.runImageRotator("wr360PlayerId");

During loading, the relative path of each image in the xml is appended to the rootPath, ie http://server2/360-assets/product1

Note: if you don't use various hot-spots from product to product, you can use just one xml for all your products and just switch image folders on the current or external server via the rootPath parameter.

brian_guess
Posts: 4
Joined: Fri Sep 14, 2012 11:16 am
Contact:

Re: Viewer setup with rootPath

Postby brian_guess » Mon Sep 17, 2012 1:20 pm

Thanks. It worked out well


Return to “Viewer Development and Customizations”

cron