Config.php - panel "false" is not working

Hi!
I made some configurations to my Kirby-installation (config.php):

<?php
    return [
     // 'false' deaktiviert das Panel
     	'panel' => false,
  
     // verschiebt den Pfad des Panels
        'panel' => ['slug' => 'authorized-personnel-only'],

     // Slug-Generator auf Deutsch setzen (Umlaute in URL umwandeln)
        'slugs' => 'de', 

     // für bessere Typografie, macht z. B. aus drei Punkten die "ellipsis"
        'smartypants' => true, 

     // aktiviert Markdown-Extras	
        'markdown' => ['extra' => true], 

     // ändert Kirby's Standard-Namen
        'home' 	=> 'fotografien', 
        'error'	=> 'fehler',
     ];

My problem: The panel is showing up, but it should not. Yes - I’ve changed the slug for the panel, so I can’t forget to change the path, when I want to activate the panel…

Thank’s a lot! :slightly_smiling_face:

Dennis

If you use the same key (in this case panel) twice, you override the first setting. An array (and this is an array what you return), must always have unique keys, so your setup doesn’t work.

1 Like

Hi Sonja!

Thank you for your help. :slight_smile:

So if I get you right, there is no way to change the slug and deactivate the panel in the same config-file. Okay - I’ll find a workaround for my needs.

Dennis

[edit] I switched the positions, the “false” as second option. When I want to activate the panel I just have to toggle the comment. PHP is confusing. to newbies… :crazy_face:[/edit]

You can just comment the option that you don’t need:

<?php
    return [
     // 'false' deaktiviert das Panel
     	'panel' => false,
  
     // verschiebt den Pfad des Panels
      //  'panel' => ['slug' => 'authorized-personnel-only'],

     // Slug-Generator auf Deutsch setzen (Umlaute in URL umwandeln)
        'slugs' => 'de', 

     // für bessere Typografie, macht z. B. aus drei Punkten die "ellipsis"
        'smartypants' => true, 

     // aktiviert Markdown-Extras	
        'markdown' => ['extra' => true], 

     // ändert Kirby's Standard-Namen
        'home' 	=> 'fotografien', 
        'error'	=> 'fehler',
     ];

Then when you want to activate the Panel, uncomment the second option and comment the first one. The order is irrelevant in that case.