Try our conversational search powered by Generative AI!

Add property to PromotionData in new marketing UI



I just started to implement the new promotion engine and the built in promotions suits me good enough but I would like to add an Xhtml property to all the built in promotions.
Is that doable without overriding everyone of them like this example shows?

Or maybe you could add a "MainBody" Xhtml property by default?

I would like to have one text in listings and another on the page where you can read about the promotion item. Of course I could use first 200 chars in listings from Description and use all of it in the presentation but a property of its own would be best.



Feb 22, 2017 10:46

Unfortunately no, there is no other way than to add your PromotionData types which inherit from the default ones.


Feb 22, 2017 11:41

I had this question a while back as well. It seems like there is no simple way of doing this. This seems to be pretty much in line with how other episerver content types work though - you need to extend the base class to be able to add your own fields to them, be it ProductContent, VariationContent or any of the promotion content types.

It's of course a bit more of hassle in this context since you have to do it for all of them, and new ones might be added with updates.

Something that helps is if you define an interface that defines the extra fields that all your extended promotions should have, then you have your extended promotions implement that interface. This helps in the future if you need to add more fields and don't want to forget about adding it to one of your extended promotion classes.

Other than that, remember that there, from v10.1 or higher, is a way do "hide" all the built in promotions so that there aren't two of each (your extended and the original one) when you open the create promotion dialog:

Feb 22, 2017 11:42

Thanks, then I will go for the 200 chars solution.


Feb 22, 2017 11:52

Thanks Jafet!
I will check with my customer. If they only want to use 4-5 of the built in promotions I could disable all and make my own with the built is as base class. We'll se.


Feb 22, 2017 12:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.