Meta title changes dynamically

came across this bug today

so I created a blog tag
for some reason, I can’t change the meta title and when I tag more than 1 post with the blog tag the meta title will change

also, I tried making a new page with the same text I’m trying to use to see if the ’ was the issue it isnt.

What is in your routes.yaml?

routes:
  

collections:
 /:
   permalink: /{slug}/
   template: index
   filter: 'primary_tag:-[blog,podcast]'
 /blog/:
   permalink: /blog/{slug}/
   template: blog
   filter: 'primary_tag:blog'

 

taxonomies:
 tag: /{slug}/
 author: /author/{slug}/

There you go! /blog/ is a collection page, not a tag page.

ok sorry I failed to mention …I’m using the collection page because I only want my posts tagged with the blog tag to appear on that page and nowhere else

is there any way for me to change the meta title on a collection page?

Here’s a couple of options for controlling the meta title of a page:

  1. Best method is to use the data key in your routes.yaml to set page data against your custom collections page. That way you can use that page in Ghost to set all the SEO and other data points. More info can be found here: Ghost Themes - Dynamic URLs & Routing
  2. Second best is to use a block helper so you can control the title value per template, this is a bit more manual but keeps templating fairly dry. I’ve explained that method over here: How to use functional helpers to select index, with custom routing? - #2 by DavidDarnes

Hope this helps!

thank you

I didn’t realize the “data line” was the missing link…got it working and tested it …can make changes on the tag settings page and it reflects as it should

routes:
   

collections:
  /:
    permalink: /{slug}/
    template: index
    filter: 'primary_tag:-[blog,podcast]'
  /blog/:
    permalink: /blog/{slug}/
    template: blog
    filter: 'primary_tag:blog'
    data: tag.blog

  

taxonomies:
  tag: /{slug}/
  author: /author/{slug}/
1 Like

No problem! Nice one working it out, thanks for sharing your code for others :raised_hands: