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

Implement Canonical URLs for Facebook's Open Graph protocol #108

Closed
hvelarde opened this issue Jun 29, 2017 · 0 comments · Fixed by #110
Closed

Implement Canonical URLs for Facebook's Open Graph protocol #108

hvelarde opened this issue Jun 29, 2017 · 0 comments · Fixed by #110

Comments

@hvelarde
Copy link
Member

Facebook uses the og:url tag to identify actions such as likes and shares aggregate at the same URL rather than spreading across multiple versions of a page.

This leads to a problems described in #104, because we're using the current URL of an item, which is calculated dynamically and inserted in the template using this:

<meta property="og:url" tal:attributes="content view/url" />

I propose the following implementation with support only for Dexterity-based content types:

  • create a Social Media behavior that could be applied to any content
  • this behavior will add a new read-only field that will contain the canonical URL of an item
  • the canonical URL will be populated on an event subscriber using information stored in the configlet and the path of the item
  • the configlet should store the schema and domain name that is being used on a site, for instance http://www.example.org/

this will solve the following issues:

  • migration to HTTPS as the user just have to edit the configuration field in the configlet and change the schema to https://www.example.org/; all items previously published will keep the original canonical URL and no counters will be lost
  • migration to a different domain name will be handled in a similar way by just updating the configuration field in the configlet with something like https://www.example.com/
  • rename of items will keep also the original canonical URL

other problems that we need to solve:

  • what happens with content already in place? we will need to provide a script to populate content already published that has no canonical URL defined
  • we need to take care of providing different canonical URL for content created before and after certain date to deal with the problem described in Migration to HTTPS zeroes Facebook page likes counters #104
  • other issues we can't foresee at this time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant