Need a little help with combining data:name with variable text

  • Hi all,

    I'm in the process of changing some krpano code so that it will support more than one language.
    My plan is to store the translations in data fields, which I think will keep the code as simple as possible.
    My plan is just to have PHP write out the data elements in the users language selection.

    The problem I'm having is that some fields that show certain information, for example one that shows the user the date and time of when the panorama was taken, I currently have something like "Taken: <timetaken>'. The actual taken time is read from the database and placed into the XML using PHP.

    I can't quite figure out how my code should look...

    Code
    <layer name="mylayername" style="somestyle" align="center" y="0"  zorder="1" html="data:mylayerdata"/>

    Works for others that don't have the requirement for the extra information.

    I tried things like

    Code
    <layer name="mylayername" style="somestyle" align="center" y="0"  zorder="1" html="data:mylayerdata some other text"/>
    Code
    <layer name="mylayername" style="somestyle" align="center" y="0"  zorder="1" html="get(data[mylayerdata].content) some other text"/>

    Is there a way to do what I want in the layer clause? Or do I need to set the text from perhaps a startup action?

    I'd like to do it using the data method in krpano, but the only other way I can think of is just to let PHP handle the translations in the preprocessing stage, though I don't think the resulting code would be quite as clean.

    Any help anyone can offer would be greatly appreciated.

    Thanks

    David

  • Hi!
    actions can't be used in tags attributes
    for example
    html="set(blabla,1);get(blabla);" can't be used

    but if you wish to do something dinamic
    try one of tricks

    in some plugin use onloaded event
    onloaded="set(html,some text);"
    or
    onloaded="set(html,data:somedata);"
    and so on

    Regards
    Andrey *thumbup*

Participate now!

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