Loading XML actions for specific devices?

  • Is there a simple way to define which <action> gets loaded for each device?

    For example, I would like buildthumbs(); to run only if I'm viewing the vtour from an iPad|iPhone|mobile, but NOT if I'm viewing via flash on a desktop web browser - it seems like we could throw a simple switch to define which device it would/not run... iPad=true, iPhone=true, flash=false;

    I realize that I can define separate html and subsequently xml for each device fork, I was hoping that we could use a universal XML to define what actions/plugins get loaded for each type of device...

    Back to my initial query, any ideas how to load the thmbnails on all devices other than desktop/flash?

  • This has worked for me. Basically it states, if it is flash then create the gallery. If it is not then build thumbs.
    Then have actions set up with those names.

    <events

    onxmlcomplete=" if(isflash, create_gallery(), buildthumbs() );"
      
    />


    Jarred

  • Thanks for the help!

    I found in another post that you can add the following line:

    set(plugin[get(thumbname)].devices, html5);

    In <action name="buildthumbs">

    Seems to work for my specific purpose, having thumbnails on everything but desktop browser - but I'm wondering if Klaus can offer a more appropriate suggestion for having actions apply to specific devices -i.e. is there a flag or switch we can throw to toggle actions for specific devices using a universal XML?

Participate now!

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