同一页面上的两个类似Facebook的按钮,带有两个不同的缩略图 [英] Two Facebook like buttons on the same page with two different thumbnails

查看:73
本文介绍了同一页面上的两个类似Facebook的按钮,带有两个不同的缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在同一页面上,我有两个不同的产品"Prod_A"和"Prod_B"

www.xyz.com/index1.html

此页面上有两张有关这些产品的图片和简短说明.

两种产品我都需要两个类似的按钮,两个类似的按钮都应该引用它们所在的页面(www.xyz.com/index1.html),但是两个按钮应该具有不同的og:图片和说明.

我找到了多个按钮的一些解决方案,但是它们引用的是不同的页面,并且没有图片.

谢谢!

PS: 一个小小的工作示例将是一个很好的例子

@DMCS说(请参阅评论),这是不可能的.当我为第二个产品www.xyz.com/index2.html创建一个虚拟页面并将其重定向到www.xyz.com/index1.html页面时,它会工作吗? 在这种情况下,我会有两页吗?

解决方案

是可以的,您需要创建与主页上的按钮一样多的虚拟页面.每个页面都包含您需要的所有OG标签,包括描述和图像.然后,您可以使用重定向将用户带回到带有按钮的页面.

使用 facebook类似按钮工具使用网址创建按钮每个伪页面的数量.这是一个虚拟页面示例:-

<html xmlns="http://www.w3.org/1999/xhtml" >

<head><title>This is a dummy page to hold the OG tags</title>

<meta property="og:title" content="This is the text the like button will show in FB when liked"/>

<meta property="og:site_name" content="the site name shown, the from name in FB"/>

<meta property="og:url" content="http://www,yoursite.com/dummp_01.html" />

<meta property="og:image" content="http://www,yoursite.com/dummyimage01.jpg" />

<meta http-equiv="refresh" content="0;url=http://www.redirect_to_url_that_has_all_the_like_buttons.com">

</head><body></body></html>

I have two different products "Prod_A" and "Prod_B" on the same page, say

www.xyz.com/index1.html

On this page are two images for these products and small descriptions.

I need two like buttons for both products, both like buttons should refer to the page where they are located ( www.xyz.com/index1.html ), but both buttons should have different og:images and descriptions.

I have found some solutions for multiple buttons, but they refer to different pages and don't have pictures included.

thanks!

PS: A small working example would be greate

Edit: @DMCS said (see comment) that this is not possible. would it work, when I create a dummy page for the second product www.xyz.com/index2.html which would redirect to the page www.xyz.com/index1.html? I this case I would have two pages is it then possible?

解决方案

Yes this is possible, you need to create as many dummy pages as you have like buttons on your main page. Each of these pages includes all the OG tags you need including descriptions and images. You then use a redirect to take the user back to the page with the buttons.

Use the facebook like button tool to create the buttons using the url of each dummy page. Here's an example dummy page:-

<html xmlns="http://www.w3.org/1999/xhtml" >

<head><title>This is a dummy page to hold the OG tags</title>

<meta property="og:title" content="This is the text the like button will show in FB when liked"/>

<meta property="og:site_name" content="the site name shown, the from name in FB"/>

<meta property="og:url" content="http://www,yoursite.com/dummp_01.html" />

<meta property="og:image" content="http://www,yoursite.com/dummyimage01.jpg" />

<meta http-equiv="refresh" content="0;url=http://www.redirect_to_url_that_has_all_the_like_buttons.com">

</head><body></body></html>

这篇关于同一页面上的两个类似Facebook的按钮,带有两个不同的缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆