Add logic when user post a blog post in back-end

Posted by Community Admin on 04-Aug-2018 11:09

Add logic when user post a blog post in back-end

All Replies

Posted by Community Admin on 06-May-2016 00:00

So i want to catch an event occurs when a back-end user posts a blog post.

 

Is there any possible way to do that?

 

 

Posted by Community Admin on 10-May-2016 00:00

Hello,

You can use the IDataEvent from the EventHub and check for the item type - whether it is a blog item - this will be called on every operation.

Please consult following documentation for additional information:
http://docs.sitefinity.com/for-developers-idataevent

eg.

private void Content_Action(IDataEvent @event)
    var action = @event.Action;
    var contentType = @event.ItemType;
    if (contentType == TypeResolutionService.ResolveType("Telerik.Sitefinity.Blogs.Model.BlogPost"))
    
        // do something
        var itemId = @event.ItemId;
        var providerName = @event.ProviderName;
        var manager = ManagerBase.GetMappedManager(contentType, providerName);
        var item = manager.GetItemOrDefault(contentType, itemId);
    

Additionally there is also following KB article on :
How to execute custom code when a shared content block is created, edited or deleted


Regards,
Dimitri Cools
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 13-Jul-2016 00:00

I have used the same for accessing & for enhance some of the custom functionality of blogpost, for that I have define some custom fields inside the blogposts so how can I access the data of this custom fields.

Posted by Community Admin on 18-Jul-2016 00:00

Hello Anand,

Once you get the blogpost, you can manage the custom field you need, as described in the sample here:
http://docs.sitefinity.com/for-developers-set-the-value-of-a-custom-field

Regards,
Svetoslav Manchev
Telerik by Progress

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed