Umbraco Ditto – How to access current mapping node inside TypeConverter

Hey everyone,

This small article is geared toward those of you who are currently using Lee Kelleher’s Ditto extension in their Umbraco projects. I won’t be explaining what Ditto or Umbraco is in this post, but I may create a post later about both.

So again, back to those of you who do use Ditto, sometimes you may run into the scenario where you want to access the current content node that is being mapped from a TypeConverter. In my situation, I had multinode treepicker, and I wanted to access the node that was picked and being mapped at the time. For instance I had an Article content item that was picked, and I needed to run some custom logic on the population/mapping of that object.

What is not in the documentation at this time of this writing is a trick in which you can grab the context from the TypeCoverter as such:

Hopefully this is quick and painless help for those of you looking for this answer.

Cheers,

Logan

Leave a Reply

Your email address will not be published. Required fields are marked *