November Happy Hour will be moved to Thursday December 5th.

Best way of Implementing a logic + Content API

Vote:
 

I have a bunch of Article pages which I can query using Content API.

I also have a separate Page type that has a Content Area property. This Content Area property holds Article pages.

The need is when I query an Article page, If that article page is part of Content Area then I need to dynamically add a property to response, probably boolean value that will indicate if the Article exists or not in the Content area.

I could possibly put some logic in TransformContent method, fetch the page type and its content and do a verification if the current article is part of content area then add the flag. Wondering if there is any better approach to do this.

#223700
Jun 02, 2020 16:19
Vote:
 

I believe you can listen on published event on parent page, which contains Content Area, when it's saved, you can iterate on ContentArea items, and update bool property to be true. Then based on that property you can extend API response. 

#225165
Edited, Jul 07, 2020 12:41
* 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.