Skip to content
Shopware

useCmsBlock

useCmsBlock

Composable to get cms block content

Types

ts
export function useCmsBlock<BLOCK_TYPE extends Schemas["CmsBlock"]>(
  content: BLOCK_TYPE,
): UseCmsBlockReturn

source code

ts
export type UseCmsBlockReturn = {
  /**
   * Cms block content
   */
  block: Schemas["CmsBlock"];
  /**
   * Get slot content by slot name (identifier)
   * @example getSlotContent("main")
   */
  getSlotContent(slotName: string): ArrayElement<Schemas["CmsBlock"]["slots"]>;
};

source code