Placeholders (%HTMLPATH%, %SWFPATH%, etc..), why to use them??

  • Hello there, I am just getting to know krpano's xml, recently I noticed placeholders but still I wonder which advantages could they bring to xml programming? Could anyone explain me the reason to use them, which advantages do they have? For example I can't see the difference between using "normal" URL like ../DIR1/DIR2 and using a placeholder like "%SWFPATH%/DIR1/DIR2".

    By the way, is it correct to write %SWFPATH%/../DIR1/DIR2, using /../ in between? Thank you very much for your help! *smile*

    Best Regards.

  • Hygiene and reusability.

    Say, you have a very deep tree structure on your webserver, with krpano xml files all over the place. You could place the *.swf and *.js files in each of the folders. But it is much smarter to have only one copy of these files, so if you ever want to upgrade krpano to a newer version you only have to update one set of files. So if you wanted to use a plugin in those xml files, you *could* use a path with lots of ../../../'s, but let me assure you that you will quickly loose count. %swfpath% makes it more "neat". Plus it will not break if you ever decide to move those xml files to different level in the folder tree.

    Another scenario is if you have generic xml files that you use in multiple projects using <include>. By using placeholders you can make these xml files truly generic and independent of their location on our webserver.

  • Okey, I see, then they help to keep a more organized structure when the project gets bigger and bigger, they're a more reliable reference to use in case of making modifications to a complex structure, right?

    Right now I'm working in a basic 3 scene tour, I tried to use placeholders for my xml references and everything worked just fine on my computer, the issue is that when I tried to embbed all my work (Except the pano images) in a single .swf file (using Kprotect) the created file presented some IO Errors. My question is, are the placeholders compatible with Kprotect use? specifically when you expect to generate a single executalbe file (.app, .exe, .swf) later.

    I appreciate your help a lot, thank you in advance!

    Best Regards.

  • I have to say that I have exhanged them all to standard paths. I discovered already at my first tests that they did not work on iPad with the structure I have.

    I assemble all the data in 1 folder and place the start index.html outside this folder.
    The place holder work with the the standard structure that the vtour produces but if you move the html outside the folder the paths only work in flash.

    Hans

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!