Integrating phpList with Facebook

Facebook encourages businesses to create "Pages" that Facebook members can then "like" (by clicking the Like button on the page).

Once a member has "liked" a page, future updates on that page are displayed on the member's news feed. Page owners can also customize the display of their pageā€”that is, pages can display exclusive content to fans who've already "liked" the page.

Facebook pages are an easy way to distribute news to your fans, including special offers, and product updates, and drive traffic back to your own website.

Prerequisites

For this section, we'll make the following assumptions:

Preparing phpList

Facebook allows us to include any content on our page in an iframe with a maximum width of 520 px. phpList's default theming won't fit in 520 px and so it will either get cut off and look odd, or will invoke awkward scroll bars in the middle of the page.

To resolve this, we'll need to change the styling of phpList. Note that this will also affect how the public URLs to our phpList site are displayed outside of Facebook (that is, the default sign up page).

Navigate to the configure page in phpList's admin interface, using the right-hand navigation panel:

Preparing phpList

Scroll down to the section starting with Header of public pages and click on edit. This is the HTML code that is added to the top of every public (not admin) page.

Preparing phpList

In the following example, we've removed the background image, the HTML table, and images, but left the CSS styling unchanged:

Preparing phpList

Having saved your changes, edit the next section labeled Footer of public pages and make the corresponding changes:

Preparing phpList

Remember that the actual content that the user sees will be "sandwiched" between the header and footer. This means that if you open a tag in the header, you need to make sure it's closed again in the footer.

Again in this example, we just closed the HTML body tag in the footer:

Preparing phpList

Having changed the header and footer of the public pages, browse to your default public page (http://your-site.com/lists/, for example) to see how the page looks:

Preparing phpList

Note that there is hardly any styling now, but that there are no fixed-width elements which will cause issues with our iframe. Tweaking the design of using the public header and footer code is a task left to the reader.

Creating the Facebook app

Before we can add phpList to our Facebook page, we need to create an App.

From http://www.facebook.com/developers/, click on the Set Up New App button:

Creating the Facebook app

Click the radio button to indicate that you agree to the Facebook terms and then click on Create App:

Creating the Facebook app

Prove you're a human by completing the CAPTCHA:

Creating the Facebook app

You're taken to the edit page for your new app. Under the Facebook Integration section, enter at least the following details:

  • IFrame Size: Auto-resize (we don't want scrollbars)
  • Tab Name (what the tab will be called when your page is displayed)
  • Tab URL (the full URL to the page you want loaded in your iframe. Generally, this would be a phpList subscribe page)
    Creating the Facebook app

Once you've saved your changes, you're taken to your list of applications. Click on Application Profile Page to see the application as other Facebook users would see it (as opposed to the developer):

Creating the Facebook app

On the application's profile page, click on Add to My Page to add this application to your Facebook page:

Creating the Facebook app

When prompted, choose which of your pages you want to add the application to. In this example, we've created a page for this book, so we add the application to this page:

Creating the Facebook app

Configuring the Facebook page

Now that we've added the application to our Facebook page, view the page and click on the Edit Page button:

Configuring the Facebook page

Under the Apps section, you'll find your application listed. Click on Edit Settings:

Configuring the Facebook page

The only setting available to us is adding a tab, so click on Add to do so:

Configuring the Facebook page

You are prompted for a custom name for your tab. The default name you chose when creating the application will be used, unless you enter a custom name. Click on Okay to complete:

Configuring the Facebook page

The next time you view your page, you'll notice an additional tab created for your application:

Configuring the Facebook page

Clicking the tab will show you your phpList installation inside an iframe:

Configuring the Facebook page

Obviously, any adjustments you make to the styling of the header and footer inside phpList will alter the way the phpList content is displayed on the Facebook page.

Making phpList the default tab on your Facebook page

You may want the phpList page to be the default tab on your page, so that when someone visits the page, the first tab they see is your phpList sign up form.

To change your page's default tab, edit the page again and click on Manage Permissions. Set the Default Landing Tab to the tab created by your app and click on Save:

Making phpList the default tab on your Facebook pagephpList-Facebook integrationFacebook page, configuring

This tab will now be shown to visitors by default, as opposed to the Wall or Info tab.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.188.121