Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Updating property of type ContentArea

Vote:
 

Hi,

I'm trying to update a pagedata which has a property of type ContentArea, say example, I'd like to remove some elements of that property but it seems that ContentArea type has some special settings that I cannot save by using either DataFactory.Instance.Save(clonedPage,SaveAction.Publish) or contentRepository.Save(...)

Do you have any idea?

 SectionPageData clone = currentPage.CreateWritableClone() as SectionPageData;
       
            if (clone.ArticleList != null)
            {              
                if (clone.ArticleList.Count > 0)
                {                    clone.ArticleList.CreateWritableClone().Fragments.RemoveAt(0);
                }              
            }
                        
            DataFactory.Instance.Save(clone, SaveAction.Publish | SaveAction.ForceCurrentVersion);

    

#66735
Mar 08, 2013 8:56
Vote:
 
SectionPageData clone = currentPage.CreateWritableClone() as SectionPageData;
      
           if (clone.ArticleList != null)
           {              
               if (clone.ArticleList.Count > 0)
               {                     clone.ArticleList.Fragments.RemoveAt(0);
               }              
           }
                       
           DataFactory.Instance.Save(clone, SaveAction.Publish | SaveAction.ForceCurrentVersion);

    

 

#66738
Mar 08, 2013 9:18
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.