How to keep field data, yet hide it in panel?

Hi guys,

I have inherited a site that was set up in a slightly altered version of Kirby. I’ve counter-hacked a bit and manager to add on panel, which is all great.

Now, my only problem is that in some cases we’ve attempted to “hide” variables that are stored in the content .txt files from the panel, but it seems that when a user saves via panel it deletes any variables not mentioned in the appropriate blueprint.

What’s a good Kirby approach for preserving hidden variables like these?

1 Like

I know you want more, this is ok.

In the meantime, you may be able to use the following field settings for this field:

    readonly: true

The panel users can not change the content of this field now.

Good luck!

1 Like

Thanks @HeinerEF - that’s definitely useful.

But yes, ideally I’d like to be a bit more greedy - no type: hidden or the like of it? Not even as an extension/plugin?

Have you tried using a type of “hidden”? Seems to work for me. Example:

fields:
    title:
        label: Title
        type:  text
    text:
        label: Text
        type:  textarea
    test:
        label: Test
        type:  hidden
3 Likes

Thanks @HYR - that’s it. Incredible how sometimes you can miss the most obvious thing.

It would help people like a great deal if it was mentioned fx here though: http://getkirby.com/docs/cheatsheet/#panel-fields :smile:

1 Like

I’ve added the hidden field to list of undocumented features on GitHub

@nivlaps You’re welcome. :smile:

@texnixe Thanks for adding it to the github project. I’ll have to remember to add documentation issues I find to the list.

For others, here’s a link to the list texnixe mentioned: https://github.com/getkirby/getkirby.com/issues