Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dominik 711 posts 733 karma points
    Apr 20, 2011 @ 14:17
    dominik
    0

    Country Picker to show hide content

    Hello,

    I need the possibility to show some content/images only for specific countries. Now it would be great to have a Country picker in the way the multinode picker does work.

    So i think i need to add a datatype called "CountryList" which includes all countries.

    For each content i should be able to select the country the images/content should be shown. This must be also a multipicker.

    For selecting the country i think i would try to use an IP locator or the user has to select it on a landingpage

    Anybody any idea how i can get this working?

     

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Apr 20, 2011 @ 14:25
    Ismail Mayat
    1

    there is a country picker datatype in uComponents it is also multi select if you want

    Regards

    Ismail

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 20, 2011 @ 14:31
    Tom Fulton
    0

    Hi dominik,

    I think what you'll have to do is create nodes for all your Countries and use MultiNodeTreePicker to select them.

    For example, create a doctype called CountryList and a doctype called Country (Name, Code, etc...).   Then create the CountryList, probably somewhere outside of your site's content node (I usually create a "Backoffice" node at level 1).  Then add your Countries underneath.

    You can then create a MultiNodePicker datatype and set the start node to the CountryList and add it to your doctype.

    This might not be ideal and might be tedious if there's a lot of possible countries, but it's the best way I can think of without doing any custom datatype development.  There is a Country Picker already in uComponents but it only supports a single selection.

    Hope this helps,
    Tom

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 20, 2011 @ 14:32
    Tom Fulton
    0

    Scratch that, didn't realize the Country Picker supported multiple selections.  Thanks Ismail

  • dominik 711 posts 733 karma points
    Apr 20, 2011 @ 14:59
    dominik
    0

    Yes i think the countryPicker is a good solution for it.

    One question about it:

    I saw the values are for example "France" but how can i set this to the ISO country code. Is this possible?

    What is the best solution to store the selected country of the landingpage to use it on the xslt macro? Just store a cookie and try to read it with jquery? Or ist there something else which can be used for it?

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft