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.
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.
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
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
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
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
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
Excellent, didn't know and never used it before... great tip thx.
Cheers,
/Dirk
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
is working on a reply...