0

Based on the Build Your Own template I am trying to create a layout with a header slot and a body slot. But I want the header slot to contain the same components the user selected on EVERY PAGE. How can I define a slot global? One of the standard layouts has this option. I don't know how they achieved this. See builder -> theme -> Header and Footer component -> "Show fixed footer" and "Fix theme header".

<template>
        <header data-f6-region class="header">
                <slot name="myheader"></slot>
        </header>
        <main data-f6-region class="body">
            <slot></slot>
        </main>
</template>

And

import { LightningElement } from 'lwc';
/**
 * @slot myheader This is the header slot
 */
export default class TessWebsiteLayout extends LightningElement {
}

Any suggestions how to achieve this?

1 Answer 1

0

The problem was that the slot name is supposed to be either header or footer to be globally the same on all pages of the layout. I was testing with several named slots and therefore the names were myheader and myheader2 and therefore not interpreted as global. Would have been cool if it was a parameter instead of a fixed name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .