Get the Toggle Text

How do i get the Toggle text in Frontend and on other Blueprints?

I tried the following:

user blueprint “kunde”

  label: Schaltung
  type: toggle
    - Automat
    - Hand

page blueprint:

  label: Auto
  type: select
  options: query
    fetch: users.filterBy("role", "kunde")
    text: "{{ user.firstname }} {{ user.lastname }} ({{ user.schaltung.text }})"

Shows only “true” or “false”!


<?=$k->firstname().' '.$k->lastname().' ('.$k->schaltung()->text().')' ?>

Shows also only “true” or “false”!

Whats wrong?:thinking:

In this case text is nothing that is stored in the text file but the values only exist in the blueprint. To access the blueprints, Kirby has the $page->blueprint() method. It returns a blueprint object that you can then use to get every piece of information from the blueprint.

1 Like