A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
All shared blocks will implement the IContent interface at runtime.
Local blocks won't.
If you call CmsBlockName on a local block, you'll get null reference exception.
I would suggest this code instead:
public static class BlockHelpers
{
public static string GetName(this BlockData block)
{
var content = block as IContent;
return content?.Name;
}
}
Hi all,
Why does this works ?
I looked everywhere and none of the ancestors of MyBlock implements IContent. So why am I able to get the name on the content block by doing this ?