Developer forum

Forum » Development » How to set built-in activation rule on item through the API

How to set built-in activation rule on item through the API

Lars Larsen
Reply

Hi,

Through the API (Code First) I have made an itemtype containing some itemfields. Now also through the API I want to add one of the built-in activation rules to my itemtype. How is that done? Isn't it possible? If not when will it be?



 

 

 

 

 

 


Replies

 
Mikkel Ricky
Reply

Currently, you can not do this. We'll take at look at it and get back to you.

Best regards,
Mikkel

 

 

 

 

 
Lars Larsen
Reply

Thanks Mikkel. I will lock forward to that. Any idea of when it could be implemented?

 

 
Daniel Plomp
Reply

Is this already possible to do?

 
Vladimir
Reply
This post has been marked as an answer

Hi Daniel,

yes with DW8.4 it is possible!

[Item("Article for news", "This item type is used for blah blah blah")]

[AreaRule, StructureRule(Dynamicweb.Content.Items.Activation.StructureContextType.Pages, Dynamicweb.Content.Items.Activation.StructureContextType.ItemList),

ParentRule(Dynamicweb.Content.Items.Activation.ParentRestrictionRule.ParentType.RootOfWebsite, Dynamicweb.Content.Items.Activation.ParentRestrictionRule.ParentType.RegularPage)]

[Category("examples")]

[CustomizedURLs]

[Icon("/Admin/Images/Ribbon/Icons/scroll2.png", "/Files/Images/1.png")]

public class Article : ItemEntry
{
}

Best regards,

Vladimir

Votes for this answer: 1
 
Daniel Plomp
Reply

Hi Vladimir,

Thanks for the follow up on this topic. Good to hear that this is possible now!

Best,
Daniel
 

 
Martin Nielsen
Reply

Hi Vladimir,

Can you add these samples to the tutorials here: http://developer.dynamicweb-cms.com/documentation/for-developers/item-based-structure/getting-started.aspx

This is pretty crucial to get Items working, sinces App-restart wipe all Non-code-first settings made on items.

 

// Martin

 
Lars Larsen
Reply

+1

 

You must be logged in to post in the forum