After adding an info field (test) to a blueprint I get an error ‘Undefined variable: page’. I must be missing something because I can’t seem to get the field to work in any of my blue prints.
Using Kirby 3.2.4
After adding an info field (test) to a blueprint I get an error ‘Undefined variable: page’. I must be missing something because I can’t seem to get the field to work in any of my blue prints.
Using Kirby 3.2.4
Could you please post your code as code? Screenshots are not useful for us. Thank you.
title: Item Page
options:
duplicate: true
columns:
left:
width: 2/3
sections:
content:
type: fields
fields:
description:
label: Description
type: textarea
size: small
help: This intro text, underneath the page heading, is also used for the meta description (between 120–168 characters) keep your most important text (keywords) within this range.
cover:
label: Cover
type: files
multiple: false
width: 1/3
layout: cards
size: tiny
cover: true
ratio: 3/2
template: image
help: Select a cover image
text:
label: Text
type: textarea
size: large
test:
label: test info
type: info
text: test
galleryHeadline:
label: Gallery {{ gallery }}
type: headline
numbered: false
gallery:
label: Gallery images
type: files
query: page.images
help: Select images and place the tag {{ gallery }} anywhere in your text to use the gallery
gallerycaptions:
label: Display gallery captions?
type: toggle
help: Display captions underneath the thumbnails. Captions, if any, will always be displayed in the lightbox view.
right:
width: 1/3
sections:
fields:
type: fields
fields:
date:
label: Published on
type: date
time: true
displaydate:
label: Display date?
type: toggle
icon: calendar
author:
label: Author
type: users
multiple: false
displayauthor:
label: Display author?
type: toggle
icon: user
tags: true
pages:
type: pages
headline: Subpages
info: "{{ page.children.count }}"
template: item-page
files:
type: files
label: Images
query: page.images
template: image
I’m not sure if this is useful without proper indentation …
Hm, I can’t reproduce the error in a Starterkit, although I haven’t tested with 3.2.4, but I can’t see anything that would cause this error, anyway. Hm
Although, your cover field definition is not correct:
cover:
label: Cover
type: files
multiple: false
width: 1/3
layout: cards
size: tiny
image: # cover and ratio are part of the image property
cover: true
ratio: 3/2
template: image
help: Select a cover image
However, that shouldn’t cause the error.
Thanks, corrected that, but error persists.
Maybe I should grab the latest kirby version?
Yes, please try that first. Also, double-check that your indentation is correct. I copy/pasted the above code without any problems, but who knows.
I’m using a blueprint which, without the info field, seems to work just alright. I just added the info field. Version 3.2.5: same error.
Having said that, I’m working on something which was made in Kirby 2 and some of the old fields are still around. Could possibly be a problem?
I don’t know, there is no page variable in your info field, does this come up with old page content or when creating a new page with this template?
I can’t create a new page after adding the info field the dialog box also shows: Undefined variable: page
And like I said all seems fine until I add an info field.
I don’t know what to say, this seems weird. Have you removed all plugins?
Could you provide the project for testing?
I just ran cleanup script:
Nothing to clean up in about-us
Nothing to clean up in docs
docs/why-kirby-cms: Undefined variable: page
docs/kirby-cms-bof-theme: Undefined variable: page
docs/installation: Undefined variable: page
docs/installation/footer: Undefined variable: page
docs/installation/header: Undefined variable: page
docs/installation/site-options: Undefined variable: page
docs/page-types: Undefined variable: page
docs/page-types/narrow-page: Undefined variable: page
docs/page-types/item-page: Undefined variable: page
docs/page-types/collection-page: Undefined variable: page
docs/page-types/collection-page/preview-panels: Undefined variable: page
docs/page-types/contact-page: Undefined variable: page
docs/page-types/home-page: Undefined variable: page
docs/typography: Undefined variable: page
docs/colors: Undefined variable: page
docs/colors/light-blue: Undefined variable: page
docs/colors/turquoise: Undefined variable: page
docs/colors/green: Undefined variable: page
docs/colors/light-green: Undefined variable: page
docs/colors/gold: Undefined variable: page
docs/colors/orange: Undefined variable: page
docs/colors/red: Undefined variable: page
docs/colors/pink: Undefined variable: page
docs/colors/purple: Undefined variable: page
docs/authors: Undefined variable: page
docs/images: Undefined variable: page
docs/blocks: Undefined variable: page
docs/banner-slider: Undefined variable: page
docs/image-slider: Undefined variable: page
docs/image-gallery: Undefined variable: page
docs/nesting-pages: Undefined variable: page
docs/nesting-pages/nesting-02: Undefined variable: page
docs/nesting-pages/nesting-02/nesting-03: Undefined variable: page
docs/nesting-pages/nesting-02/nesting-03/nesting-04: Undefined variable: page
docs/nesting-pages/nesting-02/nesting-03/nesting-04/nesting-05: Undefined variable: page
docs/nesting-pages/nesting-02/nesting-03/nesting-04/nesting-05/nesting-06: Undefined variable: page
docs/nesting-pages/nesting-02/nesting-03/nesting-04/nesting-05/nesting-06/nesting-07: Undefined variable: page
docs/multiple-languages: Undefined variable: page
docs/search-function: Undefined variable: page
Nothing to clean up in blog
blog/flightless-birds: Undefined variable: page
blog/birds-of-paradise: Undefined variable: page
blog/the-lark: Undefined variable: page
blog/humming-birds: Undefined variable: page
blog/migration-of-the-bar-tailed-godwit: Undefined variable: page
Nothing to clean up in contact
Nothing to clean up in contact/contact-sub
Nothing to clean up in error
The content file for home was updated
sandbox: Undefined variable: page
Nothing to clean up in search
Nothing to clean up in sitemap
unlisted: Undefined variable: page
Not sure about handing over the project, bit messy at the moment. But if you thinks that’s best to go forward …
About the plugins: just using the gallery example from starter and your columns approach from the cookbook.
I mean, if we trust the error message, than you are using a $page variable somewhere that is not defined. But why this throws an error in the Panel and how it might relate to the info field, I don’t know at all. In such cases it is usually the easiest to go through the project itself, rather than guessing around for ages.
The debugger doesn’t tell me anything at the front end.
Let me know how to hand this over.
You could send me a download link to a zip file via PM (Dropbox or whatever)
Done
Error is caused by an undefined $page
variable in a snippet that is called in a plugin.