A small thing I’ve been trying to work out for a while now - in just one section of my site, if create a new post, the Title field loses it’s formatting, and shows the slug instead. So Title with spaces and Capital Letters becomes title-with-spaces-and-capital-letters.
Presumably there is something in my setup (in a blueprint?) that’s causing this?
Thanks, I’ve checked the blueprint, and ‘title’ isn’t used again. One thing I did notice is that new drafts are completely blank. In other sections where this doesn’t happen the draft file has all the field names ready (even though only the title is the only one filled in). Only after I correct the title and save do the fields appear in the content file. Not sure if this is relevant?
This is the blueprint for the pages:
title: Journal Post
num: date
icon: 🖋
status:
draft:
label: Draft
unlisted:
label: In Review
listed:
label: Published
tabs:
content:
icon: text
columns:
- width: 2/3
fields:
text:
type: textarea
label: Description
size: large
- width: 1/3
fields:
date:
type: date
time: true
default: now
mainimage:
label: Masthead
type: files
layout: cards
link: false
image:
back: white
thumb:
label: Thumbnail
type: files
layout: cards
link: false
image:
back: white
tags:
label: Tags
type: tags
assets:
icon: image
sections:
assets:
type: files
size: small
layout: cards
image:
ratio: 1/1
back: white
seo: tabs/seo
Thanks David, it was worth a look, but it only has two fields. No reserved names are used. I tried a new post with that part of the blueprint removed, just to double check.
What’s your Kirby version? Which plugins do you have installed? And could you please post the blueprint with the section from which you add these new posts?
Ah, now I’m getting somewhere! I’ve got two models for the Journal section, and it’s posts. I think this is something Bastian implemented when he helped me migrate my site to Kirby. This is using the ‘fastpage’ plugin.
In the site/models/post.php I have:
<?php
use Kirby\Cms\Template;
class PostPage extends FastPage
{
const TEMPLATE = 'post';
public function cover()
{
if ($image = $this->content()->thumb()->toFile()) {
return $image;
}
if ($image = $this->content()->mainimage()->toFile()) {
return $image;
}
// take whatever is the first image
return $this->image();
}
}
If I remove the contents of that file it all works as it should. I wonder if I still need this? I can’t find any information about the fastpage plugin, and I’m not entirely sure what this file does.