From 8b1696535d395d29848dbe738d674cdd9e888ff1 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio@bekerle.com> Date: Thu, 2 Sep 2021 11:55:01 +0200 Subject: [PATCH] Add slot "title" to app shell --- packages/app-shell/README.md | 6 ++++++ packages/app-shell/package.json | 2 +- packages/app-shell/src/app-shell.js | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/app-shell/README.md b/packages/app-shell/README.md index 999053a2..c6bbfad1 100644 --- a/packages/app-shell/README.md +++ b/packages/app-shell/README.md @@ -77,6 +77,12 @@ The content of this slot will be shown left in the header and can be used to set Example: `<app-shell><template slot="name">TU Graz<br />Graz University of Technology</template></app-shell>` +#### title + +The content of this slot will be shown as big h1 headline instead of the `name` in the topic manifest file. + +Example: `<app-shell><template slot="title">TU Graz Greenlight</template></app-shell>` + #### logo The content of this slot will be shown right in the header and can be used to override the logo image. diff --git a/packages/app-shell/package.json b/packages/app-shell/package.json index 93790d4a..cfafb252 100644 --- a/packages/app-shell/package.json +++ b/packages/app-shell/package.json @@ -1,7 +1,7 @@ { "name": "@dbp-toolkit/app-shell", "homepage": "https://gitlab.tugraz.at/dbp/web-components/toolkit/-/tree/master/packages/app-shell", - "version": "0.2.5", + "version": "0.2.6", "main": "src/index.js", "license": "LGPL-2.1-or-later", "repository": { diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js index 864ae525..fd60dd70 100644 --- a/packages/app-shell/src/app-shell.js +++ b/packages/app-shell/src/app-shell.js @@ -901,7 +901,11 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) { </slot> </header> <div id="headline"> - <h1 class="title">${this.topicMetaDataText('name')}</h1> + <h1 class="title"> + <slot name="title"> + ${this.topicMetaDataText('name')} + </slot> + </h1> </div> <aside> <h2 class="subtitle" @click="${this.toggleMenu}"> -- GitLab