Facebook feed对话框:允许用户选择目的地页面或组 [英] Facebook feed dialog: allow user to select destination page or group

查看:298
本文介绍了Facebook feed对话框:允许用户选择目的地页面或组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  var p = {
method:'feed ',
name:'Title',
caption:'Subtitle - 26/02/2013',
description:'My text',
link:window.location.href
};
FB.ui(p)

有没有办法让用户选择目的地Feed的页面?
通常产生的对话框允许用户在自己的墙上发布消息。我想启用目的地选择,如:


在我的墙上或我的页面上或组中


随着页面或组的选择,如Facebook网站上发生的那样。
有没有办法显示这种选择?

解决方案

JavaScript中包含的内置共享对话框SDK不包括此功能。您将需要使用所需的选项创建自己的下拉列表,然后在其下方拥有共享按钮。然后,您需要找到此下拉列表的值,并将其添加到 FB.ui 函数的参数:

 < select id =to_user> 
< option value ={user_id}>我的墙< / option>
< option value ={page_id}>我的页面< / option>
< option value ={group_id}>我的组< / option>
< / select>

< script>
var p = {
method:'feed',
to:$('#to_user')。val(),
name:'Title',
标题:'Subtitle - 26/02/2013',
description:'My text',
link:window.location.href
};
FB.ui(p);
< / script>


I'm using a Facebook feed dialog through JavaScript:

var p = {
method: 'feed',
    name: 'Title',
    caption: 'Subtitle - 26/02/2013',
    description: 'My text',
    link: window.location.href
};
FB.ui(p)

Is there a way to allow the user select the destination page for the feed ? Usually the resulting dialog allows user to post a message on his own wall. I would like to enable destination select, like:

on my wall or on my page or into a group

With subsequent page or group selection, as happens on Facebook site. Is there a way to show this kind of selection ?

解决方案

The built-in share dialog included in the JavaScript SDK doesn't include this functionality. You will instead need to create your own dropdown with the options you want and then have the share button underneath. You will then need to find the value of this dropdown and add it to the to parameter of the FB.ui function:

<select id="to_user">
 <option value="{user_id}">My wall</option>
 <option value="{page_id}">My page</option>
 <option value="{group_id}">My group</option>
</select>

<script>
var p = {
    method: 'feed',
    to: $('#to_user').val(),
    name: 'Title',
    caption: 'Subtitle - 26/02/2013',
    description: 'My text',
    link: window.location.href
};
FB.ui(p);
</script>

这篇关于Facebook feed对话框:允许用户选择目的地页面或组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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