Open Graph Protocol - how to make it work with multiple stories on a page?

前端 未结 5 951
粉色の甜心
粉色の甜心 2021-01-12 11:46

The Open Graph Protocol is a new methodology for storing metadata to make it easier for third party sites (think the Facebook LIKE button) to identify relevant content on yo

相关标签:
5条回答
  • 2021-01-12 12:27

    According to this post , if each of your objects have a unique URL with its own metatags, it's possible to do what you want. There are proposed solutions. One with iframe (not recommended there) and one without it. I have not tested them, but will probably do it on my website soon.

    0 讨论(0)
  • 2021-01-12 12:35

    Each object is represented by a unique URL so, no, multiple objects cannot exist on a single page.

    You can have multiple like buttons on one page, but each must be set to point at a different URL by using the href attribute.

    You can make each of your object urls do a JavaScript redirect (window.location.href = new_url) to make users who arrive at each of your object pages be redirected to a single user-visible page.

    0 讨论(0)
  • 2021-01-12 12:44

    As far as I know, you're stuck - but if you figure out a way, let me know!

    I worked on a project that needed to have multiple Open Graph tags on a page - in the end, we ended up trimming down the number of items we needed OG for, so that we'd only have one story on a page.

    0 讨论(0)
  • 2021-01-12 12:47

    All I can think of is using <iframe>. Each article is gonna have its own page, suitable to be placed inside another page. And then you can display all those articles inside the master page.

    0 讨论(0)
  • 2021-01-12 12:47

    If each like button is associated with an item on the same page, then header of each item could link through to a page for just that item. That page could carry all the meta tags for the item and like button would use the url of that page. I did this here http://cinema-shorts.org/past/ (P.S. this is the first proper website Ive built so if its broken please forgive me)

    0 讨论(0)
提交回复
热议问题