Copied to clipboard

Flag this post as spam?

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


  • Eddie Foreman 215 posts 288 karma points
    Jan 10, 2011 @ 19:11
    Eddie Foreman
    0

    Mutiple Node Ids from Query String

    Hi Guys,

    Looking for some advice on creating a comparison product page for an existing site which is running on Umbraco 4.0.3.

    The current site contains a list of products.  My idea is to add a compare check box to each listed product and a compare button at the top of the page.  When the user has selected two or more products and submitted the request.   A new comparison page is displayed, showing the selected products.

    I was planning on passing the node id of each selected product as a query string. Something like, http://website/products/tvs/index.aspx?c=1190&c=1260

    A usercontrol, will be used for building the query string.  When the comparison page is loaded, is it possible to extract the node ids and pass them to a macro to display the selected products.  Guess I would need to create an xslt extension to do this?

    Any thoughts or pointers would be greatly appreciated.

    Thanks,

    Eddie

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 10, 2011 @ 20:10
    Dirk De Grave
    0

    Hmm, passing in two parameters with the same querystring key? Sounds as this wouldn't work?. Why not pass all nodes as a single string (for example, c=1190-1260) and use that value to split on the '-' char? Don't even need to pass parameters to a macro, as you can fetch the querystring value as you would in asp.net

     

    Hope this helps.

    Regards,

    /Dirk

  • Eddie Foreman 215 posts 288 karma points
    Jan 10, 2011 @ 21:42
    Eddie Foreman
    0

    Hi Dirk,

    Just been looking at using the node factory.  This looks ideal for obtaining the data of each selected product.

    Thanks again for the replying.

    Eddie

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jan 11, 2011 @ 00:24
    Chriztian Steinmeier
    1

    Hi,

    Actually, I think it's required that if a Request key is repeated that the value of it will be a comma separated list of all the values sent, e.g.:

    /homepage?v=1&v=2&v=three

    would give you the value "1,2,three" for the key "v" in the Request collection.

    Just a thought, since there are already plenty of examples of handling comma-separated ids/tags/etc...

    /Chriztian

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 11, 2011 @ 00:41
    Dirk De Grave
    0

    Excellent, didn't know and never used it before... great tip thx.

     

    Cheers,

    /Dirk

  • Eddie Foreman 215 posts 288 karma points
    Jan 11, 2011 @ 09:27
    Eddie Foreman
    0

    Hi Chriztian,

    Thanks for the confirmation on mutiple values for the same key.  I thought it was correct (although I'm no expert), as I've always used that approach.

    Eddie

Please Sign in or register to post replies

Write your reply to:

Draft