Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.
Blocks form the fundamental structure of a template and enable flexible customization of the storefront. They divide the layout into clearly named, isolated areas such as header, footer, or navigation, which can be customized independently of one another.This page covers everything there is to know about blocks in detail: what they can do, what they can’t do, and how to use them sensibly.
Blocks build on the interplay between base and view templates. The base template defines the overarching page layout with everything that stays the same on every page, for example header, footer, navigation, or included scripts. The view template is the template of a specific page. It integrates the base template via {{ extends }} and fills individual areas with page-specific content.A block is a named area within a template that is opened with {{ block name }} and closed with {{ /block }}. It is both a structural and a content building block. In the base template, it defines which areas a page has and where they are located, including default content that is displayed as long as a view template does not explicitly override this block. In the view template, it fills exactly these areas with page-specific content.
The block name is written without quotes, so {{ block header }} and not {{ block "header" }}. A name in quotes causes the compile error “Symbol expected”. Quotes belong only to file paths, for example in {{ extends "layouts/default.htm" }}.
When closing, the block name can be repeated, for example {{ /block header }}. This makes it easier to match long blocks. The name must then match the name of the opened block; otherwise, the compiler reports an error.
Instead of omitting a modifier, the default content can also be replaced explicitly with replace, for example {{ block header replace }}. Any other modifiers after the block name cause an error.The base block remains unchanged in all cases. append and prepend are useful when the default content of a block is generally fine but should be supplemented with additional content on individual pages.
Blocks cannot be defined or overridden in every template type. It depends on the role a template plays in the system:
Base templates (layout templates) define the blocks. They determine which areas of a page exist and what default content these have.
View templates (page templates) and email templates can override or extend blocks of a base template. Both integrate a base template via {{ extends }}. An important restriction applies here: a template with {{ extends }} may consist exclusively of block instructions. No HTML, no code, no include may be located outside of a block.
In the template system, there are several ways to structure and reuse code. Blocks are just one of several tools.Blocks reserve named placeholders in the layout that a view template can later fill with page-specific content. They work from top to bottom. The base template provides the framework, the view template fills it. Blocks are the link between layout and page content.Includes integrate a separate template file at a specific location, similar to a building block that can be used in multiple places. A breadcrumb or an error message are typical examples. The code is written once and integrated wherever it is needed. Unlike blocks, includes can accept variables and are therefore flexible in their parameters.Modules such as $wsBasket or $wsProducts provide data. They are not template building blocks, but server-side data sources that you access in the template.In practice, all three work together. A block defines the area of the page, includes are integrated within the block. These access the required data via modules.
Blocks such as head or scripts can contain <style> tags, <link> elements, and <script> blocks without restrictions, including inline JavaScript. Template logic within <script> tags is also possible, for example to pass server-side computed values into JavaScript:
Blocks can be nested arbitrarily deeply. This makes sense when a larger area of the layout should be divided into several independently overridable sub-areas. The base template defines the outer structure, and each inner block can be specifically overridden in the view template:
Blocks are the right tool when an area appears on multiple pages but should look different depending on the page. One example is the footer, which appears in full on normal pages with navigation, links, and contact information but is reduced to a compact variant on the login or checkout page.
If an area should look identical on multiple pages and is never overridden, an include is the better choice. The product preview in a category list, a breadcrumb bar, or an alert banner are not overridden — they are integrated. Blocks would therefore not be the right choice here.
A block should correspond to a clearly delimitable page area. Large enough to be sensibly overridable, but small enough not to change too much at once. A single block for the entire page is too large; a block per HTML element is too little. As a guideline: if you can clearly name a block and explain what it is responsible for, it is well used.
The name of a block must be unique. No base template may have two blocks with the same name; otherwise, the compiler reports an error. The name is written without quotes and should describe the purpose of the area (for example, header, content_main, scripts). Generic names such as block1 or area say nothing about what is inside and make maintenance more difficult.
A block outputs content; it does not make decisions. Price calculations, access rights, or data transformations belong in the corresponding module or in a specialized include. Blocks that contain such logic are difficult to read, hardly testable, and cannot be reused.
Deep nesting of blocks should be limited to what is necessary. The deeper the nesting, the harder it is to follow which block is actually output in the end. A rule of thumb: if a block becomes very long, parts of it belong in includes. And if the nesting becomes hard to grasp, that is a signal to simplify the structure.
An empty block in the base template. It exists only as an extension point and has no default content. A view template can fill it, but doesn’t have to.
All data provided by the system, for example product name or description, can be accessed directly within a block. This makes it possible, for example, to dynamically fill page title and meta description per product.
A view template that uses {{ extends }} may consist exclusively of block instructions. Code or HTML outside of a block is invalid and leads to errors.
{{# Invalid: code outside a block #}}{{ extends "layouts/default.htm" }}<p>This text is outside a block. It doesn't work.</p>{{ block content_main }} <p>This here is correct.</p>{{ /block }}
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"WEBSALE Dokumentation","colors":{"primary":"#0066CC"},"logo":{"light":"https://mintcdn.com/websaleag-44ee7ea6/yeKhhJTjoXWEQCsc/logo/Logo_WEBSALE_2024_Farbverlauf_RGB.png?fit=max\u0026auto=format\u0026n=yeKhhJTjoXWEQCsc\u0026q=85\u0026s=b96a564fcbb0d782bfeb7df19423835e","dark":"https://mintcdn.com/websaleag-44ee7ea6/yeKhhJTjoXWEQCsc/logo/Logo_WEBSALE_2024_Farbverlauf_RGB.png?fit=max\u0026auto=format\u0026n=yeKhhJTjoXWEQCsc\u0026q=85\u0026s=b96a564fcbb0d782bfeb7df19423835e","href":"/"},"favicon":"https://mintcdn.com/websaleag-44ee7ea6/yeKhhJTjoXWEQCsc/logo/favicon.ico?fit=max\u0026auto=format\u0026n=yeKhhJTjoXWEQCsc\u0026q=85\u0026s=5d387abffbbbc1811401ecb3afd2a807","footer":{"socials":{"linkedin":"https://www.linkedin.com/company/websale-ag"},"links":[{"items":[{"label":"Impressum","href":"https://websale.de/impressum"},{"label":"Datenschutz","href":"https://websale.de/datenschutz"}]}]},"search":{"prompt":"WEBSALE-Dokumentation durchsuchen..."},"fonts":{"family":"Roboto"},"styling":{"codeblocks":{"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}},"latex":true},"navigation":{"languages":[{"language":"de","href":"frontend"},{"language":"en","href":"en/frontend"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"websaleag-44ee7ea6","hasAudioNarration":false,"actualSubdomain":"websaleag-44ee7ea6","customDomains":["dokumentation.websale.de"],"gitSource":{"type":"gitlab","owner":"websale-ag-group","repo":"dokumentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"projectId":83013579,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae83bd9979048bc265950fb","collectionId":"3f8738e4-153c-4683-b4d9-b9f8f27070b4","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae83bd9979048bc265950fb"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae83bd9979048bc265950fb","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"de","tag":"WEBSALE","count":243},{"language":"en","tag":"WEBSALE VX","count":241},{"language":"de","tag":"Frontend","count":92},{"language":"en","tag":"Frontend","count":91},{"language":"de","tag":"Konfiguration","count":76},{"language":"en","tag":"Configuration","count":76},{"language":"de","tag":"Schnittstellen","count":58},{"language":"en","tag":"Interfaces","count":57},{"language":"de","tag":"Referenz – Module","count":39},{"language":"en","tag":"Reference – Modules","count":39},{"language":"de","tag":"Admin Interface API","count":36},{"language":"en","tag":"Admin Interface API","count":36},{"language":"de","tag":"WEBSALE | search","count":34},{"language":"en","tag":"WEBSALE | search","count":34},{"language":"de","tag":"Webcomponents – UI-Komponenten","count":22},{"language":"en","tag":"Web components – UI components","count":22},{"language":"de","tag":"Storefront API","count":17},{"language":"de","tag":"Admin Interface","count":16},{"language":"en","tag":"Admin Interface","count":16},{"language":"en","tag":"Storefront API","count":16}],"searchSettings":{"isFiltersEnabled":true,"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@websale.de","showHelpButton":false}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":has(>[data-component-part=products-selector-trigger]){flex-shrink:0!important;min-width:fit-content!important}[data-component-part=products-selector-trigger]{flex-shrink:0!important}[data-component-part=products-selector-trigger],[data-component-part=products-selector-trigger]>span{max-width:none!important;overflow:visible!important}"}],"page":{"pagePath":"en/frontend/referenz/blocke","slug":"/en/frontend/referenz/blocke","pageMetadata":{"title":"Blocks","description":"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.","href":"/en/frontend/referenz/blocke"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Blocks form the fundamental structure of a `,_jsx(_components.a,{href:`/en/frontend/die-basics/template-theme`,children:`template`}),` and enable flexible customization of the storefront. They divide the layout into clearly named, isolated areas such as header, footer, or navigation, which can be customized independently of one another.`]}),`\n`,_jsx(_components.p,{children:`This page covers everything there is to know about blocks in detail: what they can do, what they can’t do, and how to use them sensibly.`}),`\n`,_jsx(Heading,{level:`2`,id:`basic-principle`,children:`Basic principle`}),`\n`,_jsxs(_components.p,{children:[`Blocks build on the interplay between base and view templates. The `,_jsx(_components.a,{href:`/en/frontend/die-basics/template-theme#base-template-layout-template`,children:`base template`}),` defines the overarching page layout with everything that stays the same on every page, for example header, footer, navigation, or included scripts. The `,_jsx(_components.a,{href:`/en/frontend/die-basics/template-theme#view-templates-page-templates`,children:`view template`}),` is the template of a specific page. It integrates the base template via `,_jsx(_components.code,{children:`{{ extends }}`}),` and fills individual areas with page-specific content.`]}),`\n`,_jsxs(_components.p,{children:[`A block is a named area within a template that is opened with `,_jsx(_components.code,{children:`{{ block name }}`}),` and closed with `,_jsx(_components.code,{children:`{{ /block }}`}),`. It is both a structural and a content building block. In the base template, it defines which areas a page has and where they are located, including default content that is displayed as long as a view template does not explicitly override this block. In the view template, it fills exactly these areas with page-specific content.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block header }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`header`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`h1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Default header\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`h1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`header`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The block name is written without quotes, so `,_jsx(_components.code,{children:`{{ block header }}`}),` and not `,_jsx(_components.code,{children:`{{ block \"header\" }}`}),`. A name in quotes causes the compile error “Symbol expected”. Quotes belong only to file paths, for example in `,_jsx(_components.code,{children:`{{ extends \"layouts/default.htm\" }}`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`When closing, the block name can be repeated, for example `,_jsx(_components.code,{children:`{{ /block header }}`}),`. This makes it easier to match long blocks. The name must then match the name of the opened block; otherwise, the compiler reports an error.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`overriding-blocks`,children:`Overriding blocks`}),`\n`,_jsx(_components.p,{children:`A view template addresses a block by redefining it with the same name. There are the following options:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`The default content is completely replaced:`}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ extends \"layouts/default.htm\" }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block header }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`header`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`h1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Welcome to the shop!\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`h1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`header`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsxs(_components.ol,{start:`2`,children:[`\n`,_jsxs(_components.li,{children:[`With `,_jsx(_components.code,{children:`append`}),`, the new content is inserted after the default content:`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block header append }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Free shipping from €50\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsxs(_components.ol,{start:`3`,children:[`\n`,_jsxs(_components.li,{children:[`With `,_jsx(_components.code,{children:`prepend`}),`, the new content is inserted before the default content:`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block header prepend }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Free shipping today!\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Instead of omitting a modifier, the default content can also be replaced explicitly with `,_jsx(_components.code,{children:`replace`}),`, for example `,_jsx(_components.code,{children:`{{ block header replace }}`}),`. Any other modifiers after the block name cause an error.`]}),`\n`,_jsxs(_components.p,{children:[`The base block remains unchanged in all cases. `,_jsx(_components.code,{children:`append`}),` and `,_jsx(_components.code,{children:`prepend`}),` are useful when the default content of a block is generally fine but should be supplemented with additional content on individual pages.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`using-blocks-in-templates`,children:`Using blocks in templates`}),`\n`,_jsx(_components.p,{children:`Blocks cannot be defined or overridden in every template type. It depends on the role a template plays in the system:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Base templates`}),` (layout templates) define the blocks. They determine which areas of a page exist and what default content these have.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`View templates`}),` (page templates) and `,_jsx(_components.strong,{children:`email templates`}),` can override or extend blocks of a base template. Both integrate a base template via `,_jsx(_components.code,{children:`{{ extends }}`}),`. An important restriction applies here: a template with `,_jsx(_components.code,{children:`{{ extends }}`}),` may consist exclusively of block instructions. No HTML, no code, no include may be located outside of a block.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Typical blocks provided by the default layout:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.strong,{children:`Block`})}),_jsx(_components.th,{children:_jsx(_components.strong,{children:`Typical content`})})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`header`})}),_jsx(_components.td,{children:`Header area of the page`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`content_main`})}),_jsx(_components.td,{children:`Main content of the page`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`footer`})}),_jsx(_components.td,{children:`Footer area of the page`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`scripts`})}),_jsx(_components.td,{children:`JavaScript at the end of the page`})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`blocks-and-other-constructs`,children:`Blocks and other constructs`}),`\n`,_jsx(_components.p,{children:`In the template system, there are several ways to structure and reuse code. Blocks are just one of several tools.`}),`\n`,_jsx(_components.p,{children:`Blocks reserve named placeholders in the layout that a view template can later fill with page-specific content. They work from top to bottom. The base template provides the framework, the view template fills it. Blocks are the link between layout and page content.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/en/frontend/die-basics/template-theme#components-includes`,children:`Includes`}),` integrate a separate template file at a specific location, similar to a building block that can be used in multiple places. A breadcrumb or an error message are typical examples. The code is written once and integrated wherever it is needed. Unlike blocks, includes can accept variables and are therefore flexible in their parameters.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/en/frontend/referenz/module`,children:`Modules`}),` such as `,_jsx(_components.code,{children:`$wsBasket`}),` or `,_jsx(_components.code,{children:`$wsProducts`}),` provide data. They are not template building blocks, but server-side data sources that you access in the template.`]}),`\n`,_jsx(_components.p,{children:`In practice, all three work together. A block defines the area of the page, includes are integrated within the block. These access the required data via modules.`}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`permitted-content`,children:`Permitted content`}),`\n`,_jsx(Heading,{level:`3`,id:`html-and-template-syntax`,children:`HTML and template syntax`}),`\n`,_jsx(_components.p,{children:`Within a block, the following are permitted:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Any HTML`}),`\n`,_jsxs(_components.li,{children:[`Variable declarations (`,_jsx(_components.code,{children:`{{ var ... }}`}),`) and outputs (`,_jsx(_components.code,{children:`{{= ... }}`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Control structures such as `,_jsx(_components.code,{children:`{{ if }}`}),`, `,_jsx(_components.code,{children:`{{ foreach }}`}),`, `,_jsx(_components.code,{children:`{{ switch }}`})]}),`\n`,_jsxs(_components.li,{children:[`Includes (`,_jsx(_components.code,{children:`{{ include ... }}`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Module access (`,_jsx(_components.code,{children:`$wsBasket.items`}),`, `,_jsx(_components.code,{children:`$wsCheckout.sum.total`}),`, etc.)`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`javascript-and-css`,children:`JavaScript and CSS`}),`\n`,_jsxs(_components.p,{children:[`Blocks such as `,_jsx(_components.code,{children:`head`}),` or `,_jsx(_components.code,{children:`scripts`}),` can contain `,_jsx(_components.code,{children:`\u003cstyle>`}),` tags, `,_jsx(_components.code,{children:`\u003clink>`}),` elements, and `,_jsx(_components.code,{children:`\u003cscript>`}),` blocks without restrictions, including inline JavaScript. Template logic within `,_jsx(_components.code,{children:`\u003cscript>`}),` tags is also possible, for example to pass server-side computed values into JavaScript:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block scripts }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`script`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` src`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"{{= static('scripts/splide.js') }}\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` defer`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`script`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`forms`,children:`Forms`}),`\n`,_jsx(_components.p,{children:`Forms are fully permitted within blocks. This includes all common form elements (input fields, buttons, hidden fields, security mechanisms).`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block content_main }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ var $cAction = $wsActions.create(\"BasketItemAdd\") }}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`form`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` method`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"post\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` action`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"{{= $wsViews.current.url() }}\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`input`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` type`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"hidden\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` name`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"wscsrf\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` value`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"{{= $cAction.csrf }}\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`input`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` type`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"hidden\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` name`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"wsact\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` value`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"{{= $cAction.id }}\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`input`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` type`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"hidden\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` name`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"productId\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` value`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"{{= $cProduct.id }}\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`button`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` type`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"submit\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Add to basket\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`button`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`form`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`nesting`,children:`Nesting`}),`\n`,_jsx(_components.p,{children:`Blocks can be nested arbitrarily deeply. This makes sense when a larger area of the layout should be divided into several independently overridable sub-areas. The base template defines the outer structure, and each inner block can be specifically overridden in the view template:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block content }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ block sidebar }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`aside`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Default sidebar\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`aside`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ /block }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ block main }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`div`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Default content\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`div`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ /block }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A view template can then specifically override only `,_jsx(_components.code,{children:`sidebar`}),` or only `,_jsx(_components.code,{children:`main`}),` without having to touch the outer `,_jsx(_components.code,{children:`content`}),` block.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best practices`}),`\n`,_jsx(Heading,{level:`3`,id:`when-blocks-make-sense`,children:`When blocks make sense`}),`\n`,_jsx(_components.p,{children:`Blocks are the right tool when an area appears on multiple pages but should look different depending on the page. One example is the footer, which appears in full on normal pages with navigation, links, and contact information but is reduced to a compact variant on the login or checkout page.`}),`\n`,_jsx(Heading,{level:`3`,id:`when-another-construct-makes-sense`,children:`When another construct makes sense`}),`\n`,_jsx(_components.p,{children:`If an area should look identical on multiple pages and is never overridden, an include is the better choice. The product preview in a category list, a breadcrumb bar, or an alert banner are not overridden — they are integrated. Blocks would therefore not be the right choice here.`}),`\n`,_jsx(Heading,{level:`3`,id:`the-right-scope-for-a-block`,children:`The right scope for a block`}),`\n`,_jsx(_components.p,{children:`A block should correspond to a clearly delimitable page area. Large enough to be sensibly overridable, but small enough not to change too much at once. A single block for the entire page is too large; a block per HTML element is too little. As a guideline: if you can clearly name a block and explain what it is responsible for, it is well used.`}),`\n`,_jsx(Heading,{level:`3`,id:`naming-blocks`,children:`Naming blocks`}),`\n`,_jsxs(_components.p,{children:[`The name of a block must be unique. No base template may have two blocks with the same name; otherwise, the compiler reports an error. The name is written without quotes and should describe the purpose of the area (for example, `,_jsx(_components.code,{children:`header`}),`, `,_jsx(_components.code,{children:`content_main`}),`, `,_jsx(_components.code,{children:`scripts`}),`). Generic names such as `,_jsx(_components.code,{children:`block1`}),` or `,_jsx(_components.code,{children:`area`}),` say nothing about what is inside and make maintenance more difficult.`]}),`\n`,_jsx(Heading,{level:`3`,id:`business-logic-in-blocks`,children:`Business logic in blocks`}),`\n`,_jsx(_components.p,{children:`A block outputs content; it does not make decisions. Price calculations, access rights, or data transformations belong in the corresponding module or in a specialized include. Blocks that contain such logic are difficult to read, hardly testable, and cannot be reused.`}),`\n`,_jsx(Heading,{level:`3`,id:`avoiding-hard-to-maintain-structures`,children:`Avoiding hard-to-maintain structures`}),`\n`,_jsx(_components.p,{children:`Deep nesting of blocks should be limited to what is necessary. The deeper the nesting, the harder it is to follow which block is actually output in the end. A rule of thumb: if a block becomes very long, parts of it belong in includes. And if the nesting becomes hard to grasp, that is a signal to simplify the structure.`}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`simple-block`,children:`Simple block`}),`\n`,_jsx(_components.p,{children:`An empty block in the base template. It exists only as an extension point and has no default content. A view template can fill it, but doesn’t have to.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block head }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`block-with-static-content`,children:`Block with static content`}),`\n`,_jsx(_components.p,{children:`A block with fixed content that is displayed on all pages as long as no view template overrides it.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block footer }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ include \"components/layout/footerCompact.htm\" }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`block-with-variable-access`,children:`Block with variable access`}),`\n`,_jsx(_components.p,{children:`All data provided by the system, for example product name or description, can be accessed directly within a block. This makes it possible, for example, to dynamically fill page title and meta description per product.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block headMeta }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`title`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>{{= $wsViews.current.info.product.name }}\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`title`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`meta`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` name`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"description\"`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` content`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"{{= $wsViews.current.info.product.descr }}\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`block-with-conditional-output`,children:`Block with conditional output`}),`\n`,_jsx(_components.p,{children:`Blocks can contain template logic, for example to display content only under certain conditions.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block head }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ if $cStep == \"2\" }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`style`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` /* Styles needed only for checkout step 2 */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`style`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ /if }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`block-containing-another-block`,children:`Block containing another block`}),`\n`,_jsxs(_components.p,{children:[`In the base template, blocks can be nested within one another. Each inner block (here `,_jsx(_components.code,{children:`sidebar`}),` and `,_jsx(_components.code,{children:`main`}),`) is independently overridable.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{# Base template #}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block content }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ block sidebar }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`aside`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Default sidebar\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`aside`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ /block }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ block main }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`div`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>Default content\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`div`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {{ /block }}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`negative-example`,children:`Negative example`}),`\n`,_jsxs(_components.p,{children:[`A view template that uses `,_jsx(_components.code,{children:`{{ extends }}`}),` may consist exclusively of block instructions. Code or HTML outside of a block is invalid and leads to errors.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{# Invalid: code outside a block #}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ extends \"layouts/default.htm\" }}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>This text is outside a block. It doesn't work.\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ block content_main }}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>This here is correct.\u003c/`}),_jsx(_components.span,{style:{color:`#22863A`,\"--shiki-dark\":`#85E89D`},children:`p`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{{ /block }}`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}},"config":{},"pageMetadata":{"title":"Blocks","description":"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.","href":"/en/frontend/referenz/blocke"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Basic principle","slug":"basic-principle","depth":2,"children":[]},{"title":"Overriding blocks","slug":"overriding-blocks","depth":2,"children":[]},{"title":"Using blocks in templates","slug":"using-blocks-in-templates","depth":2,"children":[]},{"title":"Blocks and other constructs","slug":"blocks-and-other-constructs","depth":2,"children":[]},{"title":"Permitted content","slug":"permitted-content","depth":2,"children":[{"title":"HTML and template syntax","slug":"html-and-template-syntax","depth":3,"children":[]},{"title":"JavaScript and CSS","slug":"javascript-and-css","depth":3,"children":[]},{"title":"Forms","slug":"forms","depth":3,"children":[]}]},{"title":"Nesting","slug":"nesting","depth":2,"children":[]},{"title":"Best practices","slug":"best-practices","depth":2,"children":[{"title":"When blocks make sense","slug":"when-blocks-make-sense","depth":3,"children":[]},{"title":"When another construct makes sense","slug":"when-another-construct-makes-sense","depth":3,"children":[]},{"title":"The right scope for a block","slug":"the-right-scope-for-a-block","depth":3,"children":[]},{"title":"Naming blocks","slug":"naming-blocks","depth":3,"children":[]},{"title":"Business logic in blocks","slug":"business-logic-in-blocks","depth":3,"children":[]},{"title":"Avoiding hard-to-maintain structures","slug":"avoiding-hard-to-maintain-structures","depth":3,"children":[]}]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Simple block","slug":"simple-block","depth":3,"children":[]},{"title":"Block with static content","slug":"block-with-static-content","depth":3,"children":[]},{"title":"Block with variable access","slug":"block-with-variable-access","depth":3,"children":[]},{"title":"Block with conditional output","slug":"block-with-conditional-output","depth":3,"children":[]},{"title":"Block containing another block","slug":"block-containing-another-block","depth":3,"children":[]},{"title":"Negative example","slug":"negative-example","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"websaleag-44ee7ea6","siteName":"WEBSALE Dokumentation","title":"Blocks - WEBSALE Dokumentation","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"de":{"href":"/frontend/referenz/blocke","matchLevel":1},"en":{"href":"/en/frontend/referenz/blocke","matchLevel":0}}},"lastModified":"2026-10-30T08:19:46.290Z","originalFileLocation":"en/frontend/referenz/blocke.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.\">\u003cmeta data-mint-head name=\"application-name\" content=\"WEBSALE Dokumentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Blocks - WEBSALE Dokumentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"WEBSALE Dokumentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://dokumentation.websale.de/en/frontend/referenz/blocke\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://websaleag-44ee7ea6.mintlify.app/_mintlify/api/og/v2?division=Reference+%E2%80%93+Language\u0026amp;title=Blocks\u0026amp;description=Reference+for+blocks+in+WEBSALE+templates%3A+divide+layouts+into+named+areas+like+header%2C+footer+and+navigation+that+can+be+customized+independently.\u0026amp;theme=2f1e88ce90c5c698bc58bf46\u0026amp;signature=55d4cfc0106b81d09ab5b67fedce747a01ab9806f3927303865f1d1004d9186b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Blocks - WEBSALE Dokumentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://websaleag-44ee7ea6.mintlify.app/_mintlify/api/og/v2?division=Reference+%E2%80%93+Language\u0026amp;title=Blocks\u0026amp;description=Reference+for+blocks+in+WEBSALE+templates%3A+divide+layouts+into+named+areas+like+header%2C+footer+and+navigation+that+can+be+customized+independently.\u0026amp;theme=2f1e88ce90c5c698bc58bf46\u0026amp;signature=55d4cfc0106b81d09ab5b67fedce747a01ab9806f3927303865f1d1004d9186b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/websaleag-44ee7ea6/b-DMHJEWRrC_pLQS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"WEBSALE Dokumentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0066CC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://dokumentation.websale.de/en/frontend/referenz/blocke\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/frontend/referenz/blocke.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://dokumentation.websale.de/en/frontend/referenz/blocke\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://dokumentation.websale.de/frontend/referenz/blocke\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://dokumentation.websale.de/frontend/referenz/blocke\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://dokumentation.websale.de/#organization\",\"name\":\"WEBSALE Dokumentation\",\"url\":\"https://dokumentation.websale.de\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/websaleag-44ee7ea6/yeKhhJTjoXWEQCsc/logo/Logo_WEBSALE_2024_Farbverlauf_RGB.png?fit=max\u0026auto=format\u0026n=yeKhhJTjoXWEQCsc\u0026q=85\u0026s=b96a564fcbb0d782bfeb7df19423835e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://dokumentation.websale.de#website\",\"name\":\"WEBSALE Dokumentation\",\"url\":\"https://dokumentation.websale.de\",\"publisher\":{\"@id\":\"https://dokumentation.websale.de/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke#webpage\",\"url\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke\",\"name\":\"Blocks\",\"description\":\"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.\",\"dateModified\":\"2026-10-30T08:19:46.290Z\",\"isPartOf\":{\"@id\":\"https://dokumentation.websale.de#website\"},\"breadcrumb\":{\"@id\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Reference – Language\",\"item\":\"https://dokumentation.websale.de/en/frontend/referenz\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blocks\",\"item\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke#article\",\"headline\":\"Blocks\",\"name\":\"Blocks\",\"description\":\"Reference for blocks in WEBSALE templates: divide layouts into named areas like header, footer and navigation that can be customized independently.\",\"url\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke\",\"mainEntityOfPage\":{\"@id\":\"https://dokumentation.websale.de/en/frontend/referenz/blocke#webpage\"},\"dateModified\":\"2026-10-30T08:19:46.290Z\",\"publisher\":{\"@id\":\"https://dokumentation.websale.de/#organization\"},\"isPartOf\":{\"@id\":\"https://dokumentation.websale.de#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"WEBSALE Dokumentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"WEBSALE Dokumentation","nav":{"global":null,"languages":[{"language":"de","pages":[{"title":"de","href":"/frontend/referenz/blocke"}]},{"language":"en","products":[{"product":"WEBSALE VX","icon":"rocket","description":"Current product generation","tabs":[{"tab":"Frontend","groups":[{"group":"Frontend","pages":[{"title":"Frontend - Overview","href":"/en/frontend"}]},{"group":"The basics","pages":[{"title":"Overview - The basics","href":"/en/frontend/die-basics"},{"title":"Everything for the start","href":"/en/frontend/die-basics/alles-fur-den-start"},{"title":"Best Practice Shop","href":"/en/frontend/die-basics/bestpractice-shop"},{"title":"Template theme","href":"/en/frontend/die-basics/template-theme"},{"title":"Template engine","href":"/en/frontend/die-basics/template-engine"},{"title":"Configuration via code","href":"/en/frontend/die-basics/konfiguration-per-code"}]},{"group":"Getting started","pages":[{"title":"Getting started","href":"/en/frontend/getting-started"},{"title":"Working with GitLab","href":"/en/frontend/getting-started/arbeiten-mit-gitlab"}]},{"group":"Feature overview","pages":[{"title":"Checkout process","href":"/en/frontend/funktionsubersicht/bestellablauf"},{"title":"Browsing - Navigation between products","href":"/en/frontend/funktionsubersicht/blaettern-von-produkt-zu-produkt"},{"title":"PDF views","href":"/en/frontend/funktionsubersicht/pdf-ansichten"},{"title":"Product comparison","href":"/en/frontend/funktionsubersicht/produktvergleich"},{"title":"Scan \u0026 Order","href":"/en/frontend/funktionsubersicht/scan-and-order"},{"title":"Shop modes","href":"/en/frontend/funktionsubersicht/inaktiv-seite"},{"title":"Store finder","href":"/en/frontend/funktionsubersicht/storefinder"},{"title":"Insert codes","href":"/en/frontend/funktionsubersicht/werbemittelkennzeichnung"},{"group":"Payment methods","pages":[{"title":"Overview - Payment methods","href":"/en/frontend/funktionsubersicht/zahlungsarten"},{"title":"stripe","href":"/en/frontend/funktionsubersicht/zahlungsarten/stripe"}]},{"title":"Time-based promotional prices","href":"/en/frontend/funktionsubersicht/aktionspreise"}]},{"group":"Examples","pages":[{"title":"Practical examples - Vouchers","href":"/en/frontend/praxisbeispiele/gutscheine"},{"title":"Practical examples - Linking with the payment provider","href":"/en/frontend/praxisbeispiele/verknuepfung-zahlungsanbieter"},{"title":"Practical examples - Test mode","href":"/en/frontend/praxisbeispiele/praxisbeispiele-testmodus"},{"title":"Practical examples - Online order form","href":"/en/frontend/praxisbeispiele/online-bestellschein"}]},{"group":"Reference – Actions","pages":[{"title":"Actions - Overview","href":"/en/frontend/referenz/aktionen"},{"title":"Account","href":"/en/frontend/referenz/aktionen/account"},{"title":"Basket","href":"/en/frontend/referenz/aktionen/basket"},{"title":"Checkout","href":"/en/frontend/referenz/aktionen/checkout"},{"title":"Consent","href":"/en/frontend/referenz/aktionen/consent"},{"title":"DirectOrder","href":"/en/frontend/referenz/aktionen/directorder"},{"title":"Inquiry","href":"/en/frontend/referenz/aktionen/inquiry"},{"title":"Inventory","href":"/en/frontend/referenz/aktionen/inventory"},{"title":"Newsletter","href":"/en/frontend/referenz/aktionen/newsletter"},{"title":"ProductRating","href":"/en/frontend/referenz/aktionen/productrating"},{"title":"Session","href":"/en/frontend/referenz/aktionen/session"},{"title":"Stores","href":"/en/frontend/referenz/aktionen/stores"},{"title":"TestMode","href":"/en/frontend/referenz/aktionen/testmode"},{"title":"Voucher","href":"/en/frontend/referenz/aktionen/voucher"},{"title":"WatchList","href":"/en/frontend/referenz/aktionen/watchlist"}]},{"group":"Reference – Language","pages":[{"title":"Reference - Overview","href":"/en/frontend/referenz"},{"title":"Instructions and output","description":"Reference for WEBSALE template instructions and output syntax: control whether expressions are executed, output as values or automatically escaped.","href":"/en/frontend/referenz/anweisungen"},{"title":"Blocks","href":"/en/frontend/referenz/blocke"},{"title":"Components","description":"Reference for WEBSALE components: reusable template building blocks used to compose the storefront from smaller, isolated frontend pieces.","href":"/en/frontend/referenz/components"},{"title":"Conditions","href":"/en/frontend/referenz/conditions"},{"title":"Data types","href":"/en/frontend/referenz/datentypen"},{"title":"Functions","href":"/en/frontend/referenz/funktionen"},{"title":"Control structures","href":"/en/frontend/referenz/kontrollstrukturen"},{"title":"Loops","href":"/en/frontend/referenz/loops"},{"title":"Modifiers","href":"/en/frontend/referenz/modifiers"},{"title":"Operators","href":"/en/frontend/referenz/operatoren"},{"title":"Variables","href":"/en/frontend/referenz/variablen"}]},{"group":"Reference – Modules","pages":[{"title":"Modules - Overview","href":"/en/frontend/referenz/module"},{"title":"$wsAccount - Account \u0026 address data","href":"/en/frontend/referenz/module/wsAccount"},{"title":"$wsActions - Actions","href":"/en/frontend/referenz/module/wsactions"},{"title":"$wsAsse - Asynchronous HTTP events (ASSE)","href":"/en/frontend/referenz/module/wsasse"},{"title":"$wsBasket - Basket","href":"/en/frontend/referenz/module/wsbasket"},{"title":"$wsCategories - Categories","href":"/en/frontend/referenz/module/wscategories"},{"title":"$wsCheckout - Checkout","href":"/en/frontend/referenz/module/wscheckout"},{"title":"$wsComputopHosted - Computop (hosted payment page)","href":"/en/frontend/referenz/module/wscomputophosted"},{"title":"$wsConfig - Configuration","href":"/en/frontend/referenz/module/wsconfig"},{"title":"$wsCookie - Browser cookies","href":"/en/frontend/referenz/module/ws-cookie-browser-cookie"},{"title":"$wsConsent - Cookies \u0026 Services","href":"/en/frontend/referenz/module/wsconsent"},{"title":"$wsAccount - Account \u0026 address data","href":"/en/frontend/referenz/module/wscookies"},{"title":"$wsDirectOrder - Direct order","href":"/en/frontend/referenz/module/wsdirectorder"},{"title":"$wsEmails - Emails","href":"/en/frontend/referenz/module/wsemails"},{"title":"$wsExternalData - External data","href":"/en/frontend/referenz/module/wsexternaldata"},{"title":"$wsForm - Forms","href":"/en/frontend/referenz/module/wsform"},{"title":"$wsInventory - Stock","href":"/en/frontend/referenz/module/wsinventory"},{"title":"$wsInserts - Insert codes","href":"/en/frontend/referenz/module/wsinserts"},{"title":"$wsLastSeenProducts - Recently viewed products","href":"/en/frontend/referenz/module/wslastseenproducts"},{"title":"$wsMaintenance - Maintenance mode","href":"/en/frontend/referenz/module/wsmaintenance"},{"title":"$wsNavigation - Breadcrumb","href":"/en/frontend/referenz/module/wsnavigation"},{"title":"$wsNewsletter - Newsletter","href":"/en/frontend/referenz/module/wsnewsletter"},{"title":"$wsOptIn - Opt-in processes","href":"/en/frontend/referenz/module/wsoptin"},{"title":"$wsOrderHistory - Order history","href":"/en/frontend/referenz/module/wsorderhistory"},{"title":"$wsPayPalCheckout - PayPal","href":"/en/frontend/referenz/module/wspaypalcheckout"},{"title":"$wsProductRating - Product ratings","href":"/en/frontend/referenz/module/wsproductrating"},{"title":"$wsProducts - Product data","href":"/en/frontend/referenz/module/wsproducts"},{"title":"$wsSecurity - Encryption","href":"/en/frontend/referenz/module/wssecurity"},{"title":"$wsSession - Session data","href":"/en/frontend/referenz/module/wssession"},{"title":"$wsShipTrack - Shipment tracking","href":"/en/frontend/referenz/module/wsshiptrack"},{"title":"$wsStore - Data storage","href":"/en/frontend/referenz/module/wsstore"},{"title":"$wsStores - Stores \u0026 branches","href":"/en/frontend/referenz/module/wsstores"},{"title":"$wsStripe - Stripe","href":"/en/frontend/referenz/module/wsstripe"},{"title":"$wsSubshop - Subshop","href":"/en/frontend/referenz/module/wssubshop"},{"title":"$wsTestMode - Test mode","href":"/en/frontend/referenz/module/wstestmode"},{"title":"$wsViews - Retrieve current information","href":"/en/frontend/referenz/module/wsviews"},{"title":"$wsVoucher - Vouchers","href":"/en/frontend/referenz/module/wsvoucher"},{"title":"$wsWatchList - Watchlists","href":"/en/frontend/referenz/module/wswatchlist"},{"title":"$wsCmsPage - Output a CMS page","href":"/en/frontend/referenz/module/wscmspage"}]}]},{"tab":"Configuration","pages":[{"title":"Configuration","href":"/en/konfiguration"}]},{"tab":"Strapi CMS","pages":[{"title":"Strapi CMS","href":"/en/strapi-cms"}]},{"tab":"Interfaces","pages":[{"title":"Interfaces","href":"/en/schnittstellen"}]},{"tab":"Admin Interface","pages":[{"title":"Admin Interface","href":"/en/admin-interface"}]},{"tab":"WEBSALE | search","pages":[{"title":"WEBSALE | search","href":"/en/ws-search/websale-search"}]},{"tab":"Migration","pages":[{"title":"Migration","href":"/en/migration"}]},{"tab":"Resources","pages":[{"title":"Resources","href":"/en/changelog"}]}]},{"product":"WEBSALE V8s","icon":"clock-rotate-left","description":"Documentation of the WEBSALE V8s generation (work in progress)","pages":[{"title":"WEBSALE V8s","href":"/en/v8s"}]}]}]},"basePath":"","title":"Blocks - WEBSALE Dokumentation","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}