3

Is it possible to dynamically fetch the properties of an Experience Cloud page from an LWC or via Apex?

I'm trying to add a custom 'page title' property in an LWC to a header region of an Experience Cloud site.

For example, I'd like to get "Name" or "Title" from here:

enter image description here

CurrentPageReference allows us to get the API Name of the page:

import { LightningElement, wire } from "lwc";
import { CurrentPageReference } from "lightning/navigation";

export default class PageTitle extends LightningElement {
    pageTitle;

    @wire(CurrentPageReference)
    setCurrentPageReference(currentPageReference) {
        this.pageTitle = currentPageReference.attributes.name;
    }
}

0

You must log in to answer this question.