Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

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

Open
brandondeweese opened this issue Feb 13, 2018 · 12 comments
Open

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

brandondeweese opened this issue Feb 13, 2018 · 12 comments

Comments

@brandondeweese
Copy link

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..

@khalwat
Copy link
Collaborator

khalwat commented Feb 13, 2018

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 khalwat closed this as completed Feb 13, 2018
@brandondeweese
Copy link
Author

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

@khalwat
Copy link
Collaborator

khalwat commented Feb 14, 2018

Yeah that's definitely what should be happening.

@khalwat khalwat reopened this Feb 14, 2018
@brandondeweese
Copy link
Author

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

@brianrivet
Copy link

brianrivet commented Feb 15, 2018

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

@OisteinH
Copy link

OisteinH commented Mar 1, 2018

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?

@ghost
Copy link

ghost commented Nov 27, 2018

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

@khalwat
Copy link
Collaborator

khalwat commented Nov 27, 2018

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

@ghost
Copy link

ghost commented Nov 27, 2018

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).

@khalwat
Copy link
Collaborator

khalwat commented Nov 27, 2018

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

@ghost
Copy link

ghost commented Nov 27, 2018

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

@ghost
Copy link

ghost commented Nov 27, 2018

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"

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

No branches or pull requests

4 participants