Skip to content

Kirby 3.7.5

Data

Access key meta data about the installation and site in any Panel component.

The Panel provides a range of meta data information about the current Panel view, the Kirby installaiton and the site itself. In most places, you will be able to accessthis information directly through its key, e.g. as this.$config. In contexts wherethis is not possible, you can still access the information via window.panel, e.g. window.panel.$config.

<template>
  <p v-if="$license">This thing is registered</p>
</template>

<script>
export default {
  computed: {
    somethingFromTheCurrentView() {
      return this.$view.props.myProp;
    }
  }
}
</script>

$config

Key Description
debug Debug mode (bool)
kirbytext Kirbytext active (bool)
search Settings for Panel search (object with keys limit and type)
translation Default Panel UI language (locale string, e.g. en)
<template>
  <div v-if="$config.debug">
    This only shows wehn debug mode is active
  </div>
</template>

$direction

ltr (left-to-right) or rtl (right-to-left) depending on the currently viewed language.

$language

Info on the currently active language for a model's content.

Key Description
code Locale code
default Ifthis is the site's default language (bool)
direction Whether ltr or rtl (right-to-left)
name Name of the content language
rules Conversion rules into ASCII-only characters
this.$language.code

$languages

All available languages for site content.

Key Description
code Locale code
default Ifthis is the site's default language (bool)
direction Whether ltr or rtl (right-to-left)
name Name of the content language
rules Conversion rules into ASCII-only characters
this.$languages[0].code

$multilang

Whether the site is a multilang installation or not (bool).

$permissions

Info on the available permissions for the current user.

this.$permissions.access.system

$system

Key Description
ascii General conversion rules into ASCII-only characters
csrf Current CSRF token
isLocal Whether the site is installed locally
locales Available locales
slugs Slug-specific conversion rules based into ASCII-only characters
title Title of the site installation
this.$system.title

$translation

Info about the current language for the Panel UI, either the Panel's default language or based on currently authenticated user's setting.

Key Description
code Locale code
data Object of translated strings
direction Whether ltr or rtl (right-to-left)
name Name of the translation language
this.$translation.code

$url

Current Panel URL.

$urls

Key Description
api URL to the REST API
site URL of the main site
this.$urls.site

$user

Info on the currently authenticated user.

Key Description
email User's email address
id User id
language User's language
role User's role
username User's username
this.$user.id

$view

Info for the current Panel view.

Key Description
breadcrumb Array of breadcrumb items for the Panel's topbar
path Panel path segment of the view
props Props for the Vue view component
search Default search type for the view
this.$view.path