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

If no Facebook ID you get a template error #3

Closed
sg-modlab opened this issue Dec 29, 2015 · 7 comments
Closed

If no Facebook ID you get a template error #3

sg-modlab opened this issue Dec 29, 2015 · 7 comments

Comments

@sg-modlab
Copy link

Using the {% set seomaticMeta = { ... } %} template tag, I was getting an error about using og array. Found through a little trial and error that the issue is because I did not have a Facebook ID in my SEOMatic Social Media area set in CP.

Is there a reason that is required? I believe OG data can be useful without it. If it is required, seems a friendlier message or someway to know that is required for OG data would be helpful.

@khalwat
Copy link
Collaborator

khalwat commented Dec 29, 2015

Where were you getting these errors? Can you post what the error was? Using the Open Graph Testing Tool, do you mean?

@sg-modlab
Copy link
Author

Template rendering error. Testing tool mentioned I had no Facebook ID set for open graph which was my lead to try to put one.

Sent from my iPhone

On Dec 28, 2015, at 10:51 PM, khalwat [email protected] wrote:

Where were you getting these errors? Can you post what the error was? Using the Open Graph Testing Tool, do you mean?


Reply to this email directly or view it on GitHub.

@khalwat
Copy link
Collaborator

khalwat commented Dec 29, 2015

Forgive me, I'm trying to reproduce the error so I can fix it. I put this in my template:

{% set seomaticMeta = { 
    seoTitle: "This is the default global title of the site pages.",
    seoDescription: "This is the default global natural language description of the content on the site pages.",
    seoKeywords: "This is the default global list of comma-separated key words that are relevant to the content on the site pages.",
    seoImage: "",
    canonicalUrl: "http://nystudio107.dev/",
    twitter: { 
        card: "summary",
        site: "@nystudio107",
        title: "This is the default global title of the site pages. | nystudio107",
        description: "This is the default global natural language description of the content on the site pages.",
        image: ""
    },
    og: { 
        type: "website",
        locale: "en",
        url: "http://nystudio107.dev/admin/seomatic/social/en",
        title: "This is the default global title of the site pages. | nystudio107",
        description: "This is the default global natural language description of the content on the site pages.",
        image: "",
        site_name: "nystudio107",
        see_also: ["https://twitter.com/nystudio107"]
    }
} %}

...and made sure that the Facebook Profile ID field in SEOmatic's Social Media settings is blank. I didn't get a template error... can you post the template error you were getting, or the steps to reproduce?

@sg-modlab
Copy link
Author

This is what I used on our blog following the docs

{% set seomaticMeta = { 
    seoTitle: "Some Title",
    seoDescription: entry.summary,
    seoKeywords: "Some,Key,Words",
    seoImage: seomaticMeta.seoImage,
    canonicalUrl: entry.url,
    twitter: { 
        card: seomaticMeta.twitter.card,
        site: seomaticMeta.twitter.card,
        creator: seomaticMeta.twitter.creator,
        title: "Some Title",
        description: entry.summary,
        image: seomaticMeta.twitter.image
    },
    og: { 
        type: seomaticMeta.og.type,
        locale: seomaticMeta.og.locale,
        url: entry.url,
        title: "Some Title",
        description: entry.summary,
        image: seomaticMeta.og.image,
        site_name: seomaticMeta.og.site_name,
        see_also: seomaticMeta.og.see_also
    }
} %}

@khalwat
Copy link
Collaborator

khalwat commented Dec 29, 2015

So the issue here was that I wasn't filling in the og array if you had no Facebook Profile ID set. Which is probably not right, because as you note, you can use the og: tags even without a Facebook Profile ID set (though it's better if it is set).

I pushed a fix for you:

https://github.com/khalwat/seomatic

@khalwat khalwat closed this as completed Dec 29, 2015
@sg-modlab
Copy link
Author

Great, checking out now

@sg-modlab
Copy link
Author

Confirmed, ty

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

2 participants