Hi
I’m sure I’m doing something stupid here but I’ve tried so many combinations of things I’m wondering if someone can help.
I’ve added some fields called ‘seoTitle’ and ‘metaDescription’ to my config.yml file. Here’s an example:
collections:
- name: service
label: Service
format: yml
extension: yml
folder: data/products/
create: true
slug: '{{title}}'
fields:
- {label: "Title", name: "title", widget: "string", required: true}
- {label: "SEO title", name: "seoTitle", widget: "string"}
- {label: "Meta description", name: "metaDescription", widget: "string"}
- {label: "Publish Date", name: "date", widget: "datetime"}
- {label: "Image", name: "image", widget: "image", required: true}
- {label: "Body", name: "body", widget: "markdown"}
I’ve added them to all my collections and they’re showing up fine in the CMS.
I’m having referencing them in the title and meta description files though. I’ve tried doing it from a Slim file like this:
title: product.seoTitle
If I do it within the body it works fine but I can’t figure out how to reference it in the head - It just outputs ‘product.seoTitle’ as a string.
I’ve also tried doing it from my layout file:
title = current_page.seoTitle
That throws an error.
Would anyone mind suggesting what I’m doing wrong?