Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Use the content repository and it's method GetLanguageBranches:
IEnumerable<T> GetLanguageBranches<T>(ContentReference contentLink) where T : IContentData;
This work for pages but how can I do that for a block? Because I don't know how to create a ContentReference from a block who inherit from BlockData?
Either you have a block as a property on a parent model, for instance a page. Then you should check the page. If it's a shared block then you should have a reference to that block (either through a property or as part of a property, for instance a content area) and you can then use that reference.
Just to clarify, if it is a shared block instance you can cast the instance to IContent.
Hello,
I have a block but how can I enumerate and get this block in the different available languages?
REgards,
Benjamin