Textfield feature request. Html=external file

  • In a situation where there may be a database of near infinite content to be displayed possibly with with a textfield it would be bad to stuff it all in the xml. The other solution is pass the ball back and forth with JS. Could txtfield be upgraded to do this automatically when the html attribute points to an external file?

  • Unfortunately dynamicaly loading of external xml code is not a simple.
    by loadpano() or loadxml() you can load xml code, but pano image will be reseted.
    But you can store image and preview attributes in vars and set it again (not the best way)

    Andrey *thumbup*

    PS
    use include, it works always

  • But you can incude any file
    include url="blabla.bla"
    all what you need is just prepare this file
    witj content

    Code
    <data name="hotspot1_popup_hint">
        <p>This is hotspot number 1</P>
    </data>
    
    
    <data name="hotspot2_popup_hint">
        <p>This is hotspot number 2</P>
    </data>


    and in hotspots
    name="hotspot1"
    html="data:hotspot1_popup_hint"


    name="hotspot2"
    html="data:hotspot2_popup_hint"

    And this blabla.bla you can generate dinamicaly form any php js phyton

    Andrey

  • Different case if you want to reduce blkabla.bla file (if hotspots realy a lot in one scene)
    Then yes, this method is not the best.
    But if this hotspots not in one scene but in all tour then you can split blabla.bla for parts
    and include each part in scene you need.

    Code
    <scene name="s1">
    <include url="blabla_part1.bla"
    </scene>
    <scene name="s2">
    <include url="blabla_part2.bla"
    </scene>


    Regards
    Andrey

  • corrected
    Ha!
    I found one more option to set html dynamicaly *wink* *cool*
    You can call javascript action in onover for example.
    And call krpano action

    hotspot
    onover="js(setHShtml(get(name)));"

    javascript:
    <script>
    function setHShtml(name) {
    var krpano = document.getElementById("krpanoSWFObject");
    var text = "<p>BLABLA</p>";
    krpano.call("set(hotspot[" + name + "].html," + text + ");");
    }
    </script>

    Hehe, it's works

    Andrey *thumbup*

  • In a situation where there may be a database of near infinite content to be displayed possibly with with a textfield it would be bad to stuff it all in the xml. The other solution is pass the ball back and forth with JS. Could txtfield be upgraded to do this automatically when the html attribute points to an external file?

    Hi Sach,
    Seems like Andrey really answered this question pretty well, but maybe your intent is different than the question posted. It does seem like you are looking for a way to include an external xml file (or some other file type), and to be able to change the textfield content from an external source... assuming that external source need to be updated regularly, or just has a butt load of content.

    I recently had a need for externally based textfield content as well. My specific requirement was for dual languages which could be changed on the push of a button. My solution was to add special attributes to any text plugin that needed dynamic text. Then I ran an action to search for any plugin that had 1 of the attributes. If it did, the action would switch the content out for a different data set, but would leave all other plugins alone. I never put any html text into my tour.xml, all of the text was external, and it was a LOT.

    I'm not sure if this is similar to your intentions, but I hope it helps. If you think it is, or if you are curious, you can see the post here... post

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!