Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kirby 3: template settings override defaults instead of being merged #10

Closed
LeBenLeBen opened this issue Feb 3, 2019 · 3 comments
Closed

Comments

@LeBenLeBen
Copy link
Contributor

LeBenLeBen commented Feb 3, 2019

With the Kirby 3 plugin, there seems to be a difference in how template settings are combined with default settings.

Consider:

c::set('pedroborges.metatags.default', function($page, $site) {
  return [
    'og' => [
      'title' => $page->metatitle(),
      'type' => 'website',
      'site_name' => $site->title(),
      'url' => $page->url(),
      'description' => $page->metadescription(),
      'locale' => explode('.', kirby()->language()->locale())[0],
      'namespace:image' => [...],
    ],
  ];
});

Coupled with:

c::set('pedroborges.metatags.templates', function($page) {
  return [
    'project' => [
      'og' => [
        'namespace:image' => [...],
      ],
    ],
  ];
});

The og tags on a page with a template project contains only those defined in the templates settings, not the defaults.

With the Kirby 2 version, the template specific settings used to be merged with the default. Now they seems to simply replace them.

LeBenLeBen added a commit to LeBenLeBen/kirby-meta-tags that referenced this issue Feb 20, 2019
@pedroborges
Copy link
Owner

Thank you for the huge contribution @LeBenLeBen! Just merged you PRs.

@LeBenLeBen
Copy link
Contributor Author

@pedroborges Thank you for your time reviewing and releasing 2.0, much appreciated 🙇

@pedroborges
Copy link
Owner

You are welcome.

I have changed the option name to match the one used in v1.1.1 (with a dash). Update it your config after upgrading:

  • pedroborges.meta-tags.default
  • pedroborges.meta-tags.templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants