Get URl of a product's parent with wishlist

Jerreck McWilliams asked on March 14, 2014 08:59

How would I get the URL of a product's parent if that parent document is not a product? I need to be able to point all product URLs to their parent document within a transformation for the Wishlist web part.

Recent Answers

Brenden Kehren answered on March 17, 2014 06:24

You can use this code in your transformation <a href='<%# CMSContext.CurrentDocument.Parent.NodeAliasPath %>'><%# Eval("DocumentName") %></a> It will get the immediate parent properties of the current document.

0 votesVote for this answer Mark as a Correct answer

Richard Sustek answered on March 18, 2014 07:03

Hi Jerreck,

The product (SKU) document is just like any other document and is getting stored in CMS_Document table (apart from some specific sku fields). As you want to get URL of document you can simply use code which Brenden has suggested. You can also try exploring the CMSContext.CurrentDocument property or CMSContext.CurrentDocument.Parent to find more information about the object. You can e.g. use Parent multiple times.

Let me know if you have further questions.

Kind regards,

Richard Sustek

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.