seomatic icon indicating copy to clipboard operation
seomatic copied to clipboard

If there's no Entry Meta should it fall back to Template Meta?

Open brandondeweese opened this issue 7 years ago • 12 comments

So maybe I'm mistaken, but if a user declines or forgets to update SEO information — for example — a blog post, shouldn't that fallback to the template meta and not the site meta? My site is currently not doing that..

brandondeweese avatar Feb 13 '18 22:02 brandondeweese

Yes, it does. Twig > Entry > Template > Global

That's the fallback chain. My guess is something isn't right with your template path for the template meta.

khalwat avatar Feb 13 '18 23:02 khalwat

Hi thanks for the response, but, the template path is the correct one. I know this because I've been able to throw an error by changing something in the Template Meta. For instance, I placed {tags} in template meta SEO keywords section and it gave me an error on the correctly affected page. However, I'm unable to override any content. The screen on the left is what I'm trying to use to override the screen on the right. The screen on the right is what's naturally generated by the plugin.

What am I missing? Thanks, again!

screen shot 2018-02-13 at 3 47 04 pm

brandondeweese avatar Feb 13 '18 23:02 brandondeweese

Yeah that's definitely what should be happening.

khalwat avatar Feb 14 '18 00:02 khalwat

Yea, it's definitely not. It's pulling the description from the Site Meta. screen shot 2018-02-13 at 4 15 39 pm

brandondeweese avatar Feb 14 '18 00:02 brandondeweese

I'm having this issue as well. I have a couple of pages I'm working on that are not tied to specific entries. I have template metas set up for those templates and the template metas are pointing to the correct template paths (the template for the example is directly inside the templates folder under craft. See screen shots below). If I set up an entry with an SEOMatic field and connect it to the template then the meta renders, but if the template isn't tied to an entry it uses the site default. Also, when I look at the previews of the rendered tags etc. in the control panel those look correct, but when I bring the pages up in the browser the site meta is used, not the template meta. I've included a screenshot of the control panel for one of my template metas, the output of the tag preview in SEOMatic, and the actual code output as seen in Chrome's dev tools.

screenshot-walk-ons build-2018 02 15-10-47-32 actual_output preview_tag_render

brianrivet avatar Feb 15 '18 16:02 brianrivet

I have similar issue. I have added a Template Meta for a page. Everything looks fine in Preview, but it does not override the Site Meta when opened in a browser. I have tried deleting Craft and browser caches and different variants of Template paths but without success.

I suspect it may be related to the Template Path. My twig template, products.twig, is located in my templates/contentstructure folder. I have set Template path to contentstructure/products. In Preview the url to the page is https://www.mysite.com/contentstructure/products and the Template Meta is correct, but in a browser the url is https://www.mysite.com/products because I am using the "own URL" option for all entries in the contentstructure section. Could this be the reason it fails and is there a workaround?

OisteinH avatar Mar 01 '18 15:03 OisteinH

I'm also experiencing this issue. Anyone find a solution yet?

ghost avatar Nov 27 '18 21:11 ghost

I'd suggest using a SEOmatic Meta field rather than Template Meta. Add the SEOmatic Meta field to your Section.

khalwat avatar Nov 27 '18 21:11 khalwat

The pages in question are not tied to a CMS entry, I'm experiencing an additional issue too where setting the entry's title field as the default for SEOmatic title are not rendering either (unrelated to template meta).

ghost avatar Nov 27 '18 21:11 ghost

So in that case, what I'd suggest is that you set the meta information via Twig, as per:

https://github.com/nystudio107/seomatic/wiki/10.-Dynamic-Twig-SEO-Meta

khalwat avatar Nov 27 '18 21:11 khalwat

Cool, that should do the trick. THanks for the quick responses!

ghost avatar Nov 27 '18 21:11 ghost

Figured it out! Anyone having this issue should make sure they aren't using file extensions in their path.

For the Example: /templates/folder/_file.twig

Correct: "folder/_file"

Wrong: "/folder/_file.twig" Wrong: "folder/_file.twig" Wrong: "/folder/_file"

ghost avatar Nov 27 '18 22:11 ghost