How to Style Facebook Activity Feed

那年仲夏 提交于 2019-12-12 02:28:10

问题


How do you implement custom css on a Facebook activity feed plugin? This related post does not fully answer the question. Is this the right way?

Where does the

<fb:tag name='link'></fb:tag> 

go? Inside of of the

<fb:activity site="..." app_id="..." ></fb:activity>

outside of it, before or after? I'm sort of confused...


回答1:


Facebook PHP SDK: https://github.com/facebook/php-sdk

Comes with some simple examples, I would suggest uploading it to your server and tinkering with it, Facebook has a steep learning curve but here at Stack Overflow there is even a Facebook section: facebook.stackoverflow.com so just take each step at a time and if you can't get it by reading the facebook docs: developers.facebook.com then you can always ask here and I'm sure someone will be able to help you.

Getting Started: http://developers.facebook.com/docs/reference/php/

Once you have made an app, you add it to your fan page and then you will be abel to test what information you can get using the Graph API Explorer: https://developers.facebook.com/tools/explorer




回答2:


the only way i use activity feed is when its in a widget that will generically upate in all posts. Anyone who inserts these snippets into blog posts or other 'hard to find and edit later' posts and pages, will regret it Why? Because Facebook changes their script every month or so and the script snippet you inserted wont work anymore I have hundreds of blank areas in blog posts where i inserted an activity feed and the script always stops working after some weeks when fb adds some code or changes the location of some script or renames a file and the old script has no canonical or generic way of readjusting.

There is no point in using a script which gets made obsolete every month and you then need to find all posts where you inserted the snippet and change it for the new working code. Im always having to reinsert new code into my fb social widgets because they cease to function...

Not viable unless you take it into consideration. Only insert in spaces where oyu wil notice it when it stops working




回答3:


As Facebook Answers answered, you cannot really style it with a custom CSS, nor via JS, as the activity feed widget creates an iframe.

The info from martincarlin87 is useful, but that is not exactly what you get with the Activity Plugin, which is what you meant I guess: http://developers.facebook.com/docs/reference/plugins/activity/

For using this you cannot really interact with the Facebook API, it is a little world apart. By now... (July 12th 2012)




回答4:


That post you refer to is a red herring I'm afraid. If you put any HTML between the activity tags it gets rendered BEFORE the iframe is added. So its a no starter, from what I can see. However, I eventually found a solution, which I gave on that thread. I am repeating it here in case somebody searching doesn't see the other thread.

I managed to customise an Activity plugin, after a great deal of effort.

You can see the result here:

http://www.quniverse.co.uk/shopdata/about_us.php

Feel free to post a comment on that site, it exists purely for test purposes so I'm not fussed what goes up there provided its clean.

I explain how I achieved this in the blog article posted here:

http://facebookanswers.co.uk/?p=302

To summarise briefly:

  1. You cannot insert CSS into the activity plugin.
  2. Rely on the fact it has a transparent background, and supply your own.
  3. Turn off the header and supply your own.
  4. You can specify a light or a dark font, a few fontfaces and a border colour.

If you read the blog article you will get a full explanation.



来源:https://stackoverflow.com/questions/8745425/how-to-style-facebook-activity-feed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!