Wikia

Community Central

Facebook banner code integration

97,223pages on
this wiki

Forum page

This Forum has been archived

Visit the new Forums
Forums: Index Community Central Forum Facebook banner code integration
Wikia's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 1646 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


Hi,

I made a Facebook page for my starting french project, Guild Wars 2 Wiki. Now i want to be able to put a Facebook banner on the wiki main page. I'm using the official Facebook code for this :

<!-- Facebook Badge START --><a href="http://www.facebook.com/pages/Guild-Wars-2-Wiki/131140380244850" target="_TOP" style="font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="Guild Wars 2 Wiki">Guild Wars 2 Wiki</a><span style="font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size: 11px; line-height: 16px; font-variant: normal; font-style: normal; font-weight: normal; color: #555555; text-decoration: none;"> | </span><a href="http://www.facebook.com/business/dashboard/" target="_TOP" style="font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="Créez votre propre bannière!">Faites également la promotion de votre page</a><br/><a href="http://www.facebook.com/pages/Guild-Wars-2-Wiki/131140380244850" target="_TOP" title="Guild Wars 2 Wiki"><img src="http://badge.facebook.com/badge/131140380244850.2104.522681316.png" width="360" height="140" style="border: 0px;" /></a><!-- Facebook Badge END -->

I've pasted it on this template page. It's misbehaving because the wiki software dont want people to use some of the HTML attributes (target maybe).

So, i think it might be better to use JavaScript to insert it in the page. But, i dont know how to convert that HTML bulk into a JS string or something. So i need help from people who are better than me with JavaScript.

Thanks to all. — TulipVorlax 13:14, June 10, 2010 (UTC)

With my change to that template, use the following JS:
$(".facebook-banner").html('<a href="http://www.facebook.com/pages/Guild-Wars-2-Wiki/131140380244850" target="_TOP" style="font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="Guild Wars 2 Wiki">Guild Wars 2 Wiki</a><span style="font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size: 11px; line-height: 16px; font-variant: normal; font-style: normal; font-weight: normal; color: #555555; text-decoration: none;"> | </span><a href="http://www.facebook.com/business/dashboard/" target="_TOP" style="font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="Créez votre propre bannière!">Faites également la promotion de votre page</a><br/><a href="http://www.facebook.com/pages/Guild-Wars-2-Wiki/131140380244850" target="_TOP" title="Guild Wars 2 Wiki"><img src="http://badge.facebook.com/badge/131140380244850.2104.522681316.png" width="360" height="140" style="border: 0px;" /></a>');
--Pcj (TC) 14:16, June 10, 2010 (UTC)


OKAY! It was just to put it in single quotes; i always forget about this.
The same way i could add a Piwik tracking code into the page to get visits statistics but i wont do it because it could overload my host server. — TulipVorlax 14:55, June 10, 2010 (UTC)
You only have to use single quotes with that because the HTML contains double quotes. You could also go through and change all the double quotes to single quotes or escape all the double quotes, but just using single quotes on the outside is the easiest here. --Pcj (TC) 15:00, June 10, 2010 (UTC)
Thanks.
You can look at the main page of the wiki, it's in place now.
I will try to style it better like maybe centering it in it's column, but later... — TulipVorlax 15:02, June 10, 2010 (UTC)

Around Wikia's network

Random Wiki