如何编辑 View 输出行以包含 facebook like 按钮,并且该 like 语句应将其中一个字段作为参数并在 facebook 上输出为::
abc user likes "content of field" on mywebsite.com
最佳答案
我认为在 View 中这是可能的。
转到http://developers.facebook.com/docs/reference/plugins/like您将看到如何为类似 facebook 的按钮生成任意代码。
基本上看起来像这样
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL_HERE&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
请注意 YOUR_URL_HERE,您需要在 View 中动态替换它。首先,您应该输出一些字段,我们将其称为 Some_Field。它包含您想在 Facebook 中“点赞”的内容。它应该是一个 URL,因为 facebook 之类的工作在 URL 上。接下来,您应该添加一个自定义文本字段(在全局组下)。在文本部分中,您可以使用替换模式 [Some_Field]。所以你的文本部分将是这样的:
<iframe src="http://www.facebook.com/plugins/like.php href=[Some_Field]&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
请注意,自定义文本字段应位于 Some_Field 之后,否则 Some_Field 将无法用作替换模式。
关于drupal - 修改 drupal View 输出以显示类似 facebook 的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3318667/