Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 12:50:08 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155557 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: tutorial: Website content on your Facebookpage  (Read 724 times)
HeidemanMedia

Offline Offline

Posts: 39


WWW
« on: January 24, 2012, 02:22:46 PM »

Together with Ruud i made a nice functionality for website baker. On a facebook page you have the possibility to add pages and apps.

When you use a news page (news module, topics) on your website or like my example the catalist module. you have the possibility to add this page in a iframe on your Facebook page:

step 1: go to your Facebook page
step 2: in the search box you search on 'Static HTML: iframe tabs'
step 3: add the application
step 4: change core WB

In the /index.php (root index)
 
Between $wb->page_select() and $wb->get_page_details(); you copy/paste the code down here:
 
Code:
// Sticky Template switcher
// get the template to display from URL
if (isset($_GET['template'])) {
     if(file_exists(WB_PATH.'/templates/'.$_GET['template'].'/index.php')) {
          define('TEMPLATE',$_GET['template']);
          $_SESSION['TEMPLATE']=TEMPLATE;
     }
} else { // get the template to display from Session Variable
     if(isset($_SESSION['TEMPLATE']) AND $_SESSION['TEMPLATE'] != '')
          define('TEMPLATE',$_SESSION['TEMPLATE']);
}

step 5: go back to your Facebook page
step 6: go to the app and make a iframe of your site

<IFRAME SRC="http://yoursite.com/pages/cars.php?template=FB" WIDTH=480 HEIGHT=1600> </IFRAME>

step 7: with the code of step 4 you have the possibility to change the template. Add ' ?template=yourtemplate' behind the URL en switch from template.
step 8: So make a template for Facebook
step 9: add the iframe  code to the Facebook app and done!
step 10: to change the page name go to settings and then to apps and modify the page name

I add a example picture down here from a client.

The nice thing is you use a iframe so you don't have to make double content when your website is up to date your Facebook page is also up to date. Let me know if you find this tutorial usefull.



« Last Edit: January 25, 2012, 04:40:52 PM by HeidemanMedia » Logged

___________________ ___________________ ___
Heideman Media - Holland
NorHei
Forum administrator
*****
Offline Offline

Posts: 485



WWW
« Reply #1 on: January 25, 2012, 11:12:13 PM »

Great Idea!
Logged

It is easier to change the specification to fit the program than vice versa.
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #2 on: January 26, 2012, 09:36:04 AM »

great tutorial !

I have an idea to add an extra code parameter somewhere, so that noone can use "light" version of website except when going via FB Smiley
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #3 on: January 26, 2012, 10:10:00 AM »

You could simply add a referer check in the template switcher.
if ".facebook." is somewhere in the referer string then allow the switch.
Logged

Professional WebsiteBaker Solutions
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #4 on: January 26, 2012, 10:48:37 AM »

great idea Ruud.

My idea was to ad a random secret code variable in url, like: www.mysite.xy/pages/facebook.php?code=12345

as you want see url with code on inframe app, like Victoria secret page Smiley

Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
HeidemanMedia

Offline Offline

Posts: 39


WWW
« Reply #5 on: January 26, 2012, 01:00:14 PM »

Thanx.. and thanx to ruud:)

When someone made a page pleas share it with us, i am looking forward for more FB ideas:)
Logged

___________________ ___________________ ___
Heideman Media - Holland
HeidemanMedia

Offline Offline

Posts: 39


WWW
« Reply #6 on: January 26, 2012, 01:04:33 PM »

the only problem i have at this moment is:

the first page is nice but de next link you click doesn't contains no "?template=FB" and te template turns back to the normal page.

look on:

https://www.facebook.com/pages/Autoroben/165960606840269?sk=app_190322544333196
Logged

___________________ ___________________ ___
Heideman Media - Holland
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #7 on: January 26, 2012, 01:12:38 PM »

The used template is stored in a session variable, so it should stay that template for the current session.
For me your page keeps using the FB template.

Maybe your browser does not accept (session)cookies?
Logged

Professional WebsiteBaker Solutions
HeidemanMedia

Offline Offline

Posts: 39


WWW
« Reply #8 on: January 26, 2012, 01:22:08 PM »

you right on a other computer the template stays Smiley then is that te problem! I am really enthusiastic about this:) also nice for bakery shopping in your FB page:)
Logged

___________________ ___________________ ___
Heideman Media - Holland
dbs
WebsiteBaker Org e.V.

Offline Offline

Posts: 3719


WWW
« Reply #9 on: January 26, 2012, 02:35:27 PM »

the same way, but another...
http://www.facebook.com/pages/WebsiteBaker-Portable/201748853207120

- extra-template for facebook
- module sectionpicker shows the news
- without extra-code

edit: the extra-code in post 1 is a good idea, will test it.

« Last Edit: January 26, 2012, 03:02:24 PM by dbs » Logged

crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #10 on: January 26, 2012, 03:08:58 PM »

the only problem i have at this moment is:

the first page is nice but de next link you click doesn't contains no "?template=FB" and te template turns back to the normal page.

look on:

https://www.facebook.com/pages/Autoroben/165960606840269?sk=app_190322544333196

in ff it looks ok, bit in ie8 when I change category to mercedes template changes to green one
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!