将开放图形动作与多个对象相关联标题模板 [英] Associating open graph action with multiple objects & caption template

查看:115
本文介绍了将开放图形动作与多个对象相关联标题模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在建立一个具有Facebook Open Graph集成的网站。



我有一个复杂因素是因为用户可以对我们网站上的不同对象执行类似的操作,我们很容易为每个类似的动作定义不同的动作。然而,似乎Facebook不允许(或至少不喜欢)一个网站有多个类似的操作。



例如,假设用户可以同时购买汽车,并在我们的网站上买保险。
虽然表面上这两个动作看起来是相似的,因为他们的上下文是不同的,我们要显示不同的内容 - 更具体的不同的标题 - 对于每个被发布的动作。



实现这一点的简单方法将定义两个操作,
'BuyCar'< --->与保险$ b $相关联的Car
'BuyInsurance'< ---> b,让他们有独特的标题模板。



然而,正如我前面提到的,因为Facebook不允许在一个网站内定义多个类似的动作,我应该定义。
'购买'< ---->与[Car,Insurance]
相关联,其中此操作始终只有一个属性定义。 (汽车或保险)
由于目前的阳性模板语言(缺少条件语句)的限制,有这些类型的操作的缺点,我无法在不知道设置哪个属性的情况下有效地生成不同的标题。 / p>

我应该如何处理这个问题?



您的帮助将不胜感激。
谢谢

解决方案

我认为这些标题确实需要一些可以适用于所有连接的对象类型的泛型。但是您可以使用过滤器为每个对象类型定义单独的聚合。



只需向所有对象添加一个附加参数,并将该参数的值设置为聚合过滤器


Currently I am building a site with a Facebook Open Graph integration.

One complication I have is since user can do seemingly similar actions to different objects on our site, it is easy for us to define different action for each similar actions. However, it seems like Facebook is not allowing ( or at least not liking ) for one site to have multiple similarly looking actions.

For instance, let's assume that user can both 'buy' a car, and 'buy' an insurance in our site. Although, on surface, these two action look similar, because their context is different we want to show different content - more specifically different caption - for each action that is postsed.

Simple way to implement this will be defining two actions, 'BuyCar' <---> associated with Car 'BuyInsurance' <---> associated with Insurance and let them have distinctive caption template.

However, as I mentioned earlier, since Facebook does not allow multiple similar actions to be defined within a site, I should be defining. 'Buy' <----> associated with [Car, Insurance] where this action always have only one property defined. (either Car or Insurance) Downside of having these type of action is, due to limitation in current cation's template language (lacks conditional statement), I am not able to produce different caption effectively without knowing which property is set.

How should I be handling this issue?

Your help will be greatly appreciated. Thanks

解决方案

I think the captions do need to be something generic that will work for all connected object types. But you could use filters to defined separate aggregations for each object type.

Just add an additional parameter to all of your objects and set the value of that parameter as an aggregation filter?

这篇关于将开放图形动作与多个对象相关联标题模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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