Copied to clipboard

Flag this post as spam?

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


  • ramu ajay 9 posts 29 karma points
    Nov 05, 2010 @ 16:43
    ramu ajay
    0

    Handler in xslt

    Can anyone suggest how to add a handler in xslt...Please any suggestions are greatly appreciated.

    Thank You

     

  • Lachlann 344 posts 626 karma points
    Nov 05, 2010 @ 17:08
    Lachlann
    0

    Hey,

     

    Do you mean like an Event Handler? Not sure this would be possible.

     

    L

  • ramu ajay 9 posts 29 karma points
    Nov 05, 2010 @ 17:14
    ramu ajay
    0

    HI LACHLANN,

    it's not an event handler....It's aa handler.ashx. 

    Thanks for the reply

  • Lachlann 344 posts 626 karma points
    Nov 05, 2010 @ 17:26
    Lachlann
    0

    Oh this might be a bit over my head, is it something you could create an extension for?

     

    L

  • jc 64 posts 101 karma points
    Nov 05, 2010 @ 17:33
    jc
    0

    I don't think you could truly do it in an XSLT macro. You may want to take a look at /Base as an alternative:

    http://our.umbraco.org/wiki/reference/umbraco-base

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Nov 05, 2010 @ 17:52
    Lee Kelleher
    0

    Hi Ramu,

    Could you provide some details on what you are trying to achieve within the XSLT?  What do you want to do with the ASHX handler?

    We might be able to suggest alternatives.

    Cheers, Lee.

  • ramu ajay 9 posts 29 karma points
    Nov 05, 2010 @ 21:57
    ramu ajay
    0

    Hi Lee,

    Ashx handler brings the userlocation say country and region........right now I am hardcoding my value in the xsl param  so that in the xslt logic if there is a match in countrycode render the espective content.......So instead of hardocding I need a way to grab the value of handler 

    Thanks

  • ramu ajay 9 posts 29 karma points
    Nov 05, 2010 @ 21:58
    ramu ajay
    0

    Thanks jc 

  • jc 64 posts 101 karma points
    Nov 06, 2010 @ 00:33
    jc
    1

    If you're wanting country and region information, I'd imagine you'd have to:

    1. Get the user's IP: umbraco.library:RequestServerVariables('REMOTE_ADDR')
    2. Create an XSLT extension to pass that into: http://en.wikibooks.org/wiki/Umbraco/Create_xslt_exstension_like_umbraco.Library_in_C
    3. Have some geolocation service or software on the server to do the lookup: http://www.ip2location.com/default.aspx or http://www.geoio.com/ for example
  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Nov 07, 2010 @ 21:26
    Lee Kelleher
    0

    Hi Ramu,

    As JC says, it sounds like you would be better to write an XSLT extension to retrieve the user data (location, country/region).

    Cheers, Lee.

     

Please Sign in or register to post replies

Write your reply to:

Draft