This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
addons:social_connect:hide_header [2012/04/09 17:58] jonyo |
addons:social_connect:hide_header [2015/08/03 19:40] (current) geojames |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Hide Sections in Facebook Page/App ====== | ====== Hide Sections in Facebook Page/App ====== | ||
- | One of the things you can do with a Facebook App, is make your website display //inside// Facebook as a " | + | This tutorial |
- | + | ||
- | <tip c n> | + | |
- | + | ||
- | **Notes/ | + | |
- | * These instructions assume you are using a site design //close// to the default design in versions 5.0 and up. If your site is dramatically different, the template files you edit and where you need to add certain parts like JS code and CSS will be different. < | + | |
- | * You will need to already have your Facebook App set up and configured correctly, as instructed in the instructions for setting up Login with Facebook. < | + | |
- | * Your site **must** have an SSL certificate, | + | |
- | * In the admin at **Site Setup > General Settings**: | + | |
- | * You **must** have the setting **Force SSL URL** turned **off** (un-checked), | + | |
- | * Make sure the setting **Secure SSL Site URL** is set correctly. < | + | |
- | < | + | |
- | + | ||
- | + | ||
- | **Instructions: | + | |
- | - Go to **Design > Manager** and edit the template file **header.tpl** in your main template set, usually **my_templates**. | + | |
- | - Find this part: <code html>< | + | |
- | - Add the CSS class " | + | |
- | - Save the changes. < | + | |
- | - Browse your templates, and find any other sections or parts that you do not want to show when the site is in Facebook, and add the **no_facebook** CSS class to those parts. | + | |
- | - Edit **front_page.tpl** < | + | |
- | - Find this line (which is the " | + | |
- | <div id=" | + | |
- | - Add the " | + | |
- | <div id=" | + | |
- | - Save changes < | + | |
- | < | + | |
- | - If you wish to do this on an element that already | + | |
- | - Later on, you will be able to add the **no_facebook** CSS class to other parts of the template as well, so don't worry too much about finding everything you want to hide right now. Just get the "main parts" you might not want to show, such as anything in the header or footer that you do not want to show. You just need enough so that it is easy to see if the show/hide sections is working correctly. < | + | |
- | - Now, you will add a section to the head.tpl that will " | + | |
- | - In the **head.tpl** file, find this section: <code html></ | + | |
- | - **Replace** that with((NOTE: Make sure it does not already have this in the template, if it does then no need to add it again!)): <code html>< | + | |
- | //<![CDATA[ | + | |
- | /* | + | |
- | * Facebook show/hide sections of the page, based on if it is in a frame | + | |
- | * or not. (if in a frame, assume it is inside facebook app). Note that | + | |
- | * we " | + | |
- | * it is NOT in facebook, it " | + | |
- | * should prevent the "shows for a second" | + | |
- | */ | + | |
- | if (top.location == location) { | + | |
- | //This is " | + | |
- | //only be hidden when in facebook. | + | |
- | Event.observe(window, | + | |
- | $$(' | + | |
- | elem.removeClassName(' | + | |
- | }); | + | |
- | }); | + | |
- | } | + | |
- | //]]> | + | |
- | </ | + | |
- | <style type=" | + | |
- | /* don't show sections in facebook */ | + | |
- | .no_facebook { display: none; } | + | |
- | </ | + | |
- | </ | + | |
- | < | + | |
- | - Save the changes. < | + | |
- | - Now browse your site " | + | |
- | - Go to http:// | + | |
- | * If not already configured, click on **App on Facebook** < | + | |
- | * Enter the **Canvas URL** to be the main URL for your classifieds site, for instance if the software was installed at the base of example.com you would enter "< | + | |
- | * Enter the **Secure Canvas URL** to be the " | + | |
- | < | + | |
- | - Save the Facebook App settings. < | + | |
- | - Visit the URL it shows for the **Canvas Page** in the same section within the Facebook App settings. | + | |
- | - **Optional: | + | |
- | - Within the Facebook App settings((On http:// | + | |
- | - Under **Canvas Settings**, change **Canvas Width** to **Fluid**. < | + | |
- | - Save changes, then refresh (or re-visit) your app's canvas page, and make sure it displays without the horizontal scroll-bar now. < | + | |
- | < | + | |
- | - **Optional: | + | |