While installing Drupal for Facebook,
"In order to display FBML tags, IE requires the attribute: xmlns:fb="http://www.facebook.com/2008/fbml" in the tag"
But can not find the tag inside ../themes/at-commerce/templates/page.tpl.php
And it seems conflict if I added...
print $language " lang=" print $language " xmlns:fb="http://www.facebook.com/2008/fbml">

Thanks,
Sam

Comments

stan turyn’s picture

adaptivetheme/templates/html.tpl.php

Jeff Burnz’s picture

Category: bug » support
Status: Active » Closed (fixed)

Thanks Steve.

mubiesam’s picture

Found it here, but no matter where I add the needed code, IE still can not display FBML tags...(cache cleared)

Is there anything else I need to do...

Thanks,
Sam

sites/all/themes/adaptivetheme/adaptivetheme/at_core/templates/html.tpl.php

?><!DOCTYPE html>
<!--[if IEMobile 7]><html class="iem7" <?php print $html_attributes; ?> xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if lte IE 6]><html class="lt-ie9 lt-ie8 lt-ie7" <?php print $html_attributes; ?> xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if (IE 7)&(!IEMobile)]><html class="lt-ie9 lt-ie8" <?php print $html_attributes; ?> xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if IE 8]><html class="lt-ie9" <?php print $html_attributes; ?> xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)]><!--><html <?php print $html_attributes . $rdf_namespaces; ?> xmlns:fb="http://www.facebook.com/2008/fbml"><!--<![endif]-->
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $scripts; ?>
<?php print $polyfills; ?>
</head>
<body class="<?php print $classes; ?>"<?php print $attributes; ?>>
<div id="skip-link">
<a href="<?php print $skip_link_target; ?>" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?></a>
</div>
 <?php print $page_top; ?>
 <?php print $page; ?>
 <?php print $page_bottom; ?>
</body>
</html>
mubiesam’s picture

Status: Closed (fixed) » Active

Seems need to change the status for your attention...Sam

Jeff Burnz’s picture

Title: Can not find <html> tag in the page.tpl.php » How to add xmlns:fb="http://www.facebook.com/2008/fbml" to html element

OK, couple of things:

1. Copy html.tpl.php to your subtheme and clear the cache, then modify it. In general don't hack the core themes files.

2. What do you mean "IE still can not display FBML tags"? Please explain in detail.

Looking at this issue I can see we have the $html_attributes variable but its a string, I think we should turn this into structured data and make it a proper attributes array, this would make things like this very easy to do in preprocess.

mubiesam’s picture

1. Copied html.tpl.php to ../sites/all/themes/at-commerce/templates/ and added xmlns:fb="http://www.facebook.com/2008/fbml" to every line of $html_attributes variable accordingly, but "IE still can not display FBML tags", means there should be a button to click for login into Drupal using FB account, but IE can not display that button, only a plain text "Connect" which has no function at all.

2. Another problem for IE is the slideshow, instead of the slideshow rotating, there are 3 separate photos displayed.

Can you guide me more detail for how to "make it a proper attributes array"...

Thanks,
Sam

Jeff Burnz’s picture

mubiesam - ok, I understand now. Can you tell how to reproduce this, is it some module or code you use from Facebook? Is this http://drupal.org/project/fb? A few words on how I can reproduce this would be very useful.

Don't worry about the attributes array thing, its not going to help you in this instance, it will produce the same output you are doing manually.

mubiesam’s picture

Hi Jeff,

You can use IE to take a look here...http://www.insync-asia.com/ifood/

It is installed with module Drupal for Facebook http://drupal.org/project/fb

In the installation guide http://drupal.org/node/923804 , there is a Theme change

In order to display FBML tags, IE requires the attribute: xmlns:fb="http://www.facebook.com/2008/fbml" in the tag, which is part of your theme. Manually edit your theme's page.tpl.php file, adding that attribute alongside the others in the .

Another problem related to fb module, it will show these error message on FB Canvas page, but nothing wrong in Drupal site...
Notice:Undefined index: content 於 fb_example_preprocess_page() (/home3/insyncas/public_html/ifood/sites/all/modules/fb/contrib/fb_example.module 中的第 328 行)。
Notice:Undefined index: header 於 fb_example_preprocess_page() (/home3/insyncas/public_html/ifood/sites/all/modules/fb/contrib/fb_example.module 中的第 328 行)。
Notice:Undefined index: footer 於 fb_example_preprocess_page() (/home3/insyncas/public_html/ifood/sites/all/modules/fb/contrib/fb_example.module 中的第 328 行)。
Notice:Undefined index: left 於 fb_example_preprocess_page() (/home3/insyncas/public_html/ifood/sites/all/modules/fb/contrib/fb_example.module 中的第 328 行)。
Notice:Undefined index: preface_first 於 fb_example_preprocess_page() (/home3/insyncas/public_html/ifood/sites/all/modules/fb/contrib/fb_example.module 中的第 328 行)。
Notice:Undefined index: preface_middle 於 fb_example_preprocess_page() (/home3/insyncas/public_html/ifood/sites/all/modules/fb/contrib/fb_example.module 中的第 328 行)。
Notice:Undefined index: preface_last 於 fb_example_preprocess_page() (/home3/insyncas/public_html/ifood/sites/all/modules/fb/contrib/fb_example.module 中的第 328 行)。

Thanks,
Sam

Jeff Burnz’s picture

This is what I see when I view your site, so this would only work in IE10+ and Windows mobile 8+.

<!DOCTYPE html>
<!--[if IEMobile 7]><html class="iem7" lang="en" dir="ltr"><![endif]-->
<!--[if lte IE 6]><html class="lt-ie9 lt-ie8 lt-ie7" lang="en" dir="ltr"><![endif]-->
<!--[if (IE 7)&(!IEMobile)]><html class="lt-ie9 lt-ie8" lang="en" dir="ltr"><![endif]-->
<!--[if IE 8]><html class="lt-ie9" lang="en" dir="ltr"><![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)]><!--><html lang="en" dir="ltr"
  xmlns:fb="http://www.facebook.com/2008/fbml"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/terms/"
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:og="http://ogp.me/ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:sioc="http://rdfs.org/sioc/ns#"
  xmlns:sioct="http://rdfs.org/sioc/types#"
  xmlns:skos="http://www.w3.org/2004/02/skos/core#"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"><!--<![endif]-->
mubiesam’s picture

You mean even with these changes, it still will not work with IE under 9...

Jeff Burnz’s picture

You haven't made any changes, that is my point - LOOK at the code from your site - there needs to be one attribute for each line to target all versions of IE:

<!--[if IEMobile 7]><html class="iem7" lang="en" dir="ltr" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if lte IE 6]><html class="lt-ie9 lt-ie8 lt-ie7" lang="en" dir="ltr" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if (IE 7)&(!IEMobile)]><html class="lt-ie9 lt-ie8" lang="en" dir="ltr" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if IE 8]><html class="lt-ie9" lang="en" dir="ltr" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)]><!--><html lang="en" dir="ltr"
  xmlns:fb="http://www.facebook.com/2008/fbml"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/terms/"
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:og="http://ogp.me/ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:sioc="http://rdfs.org/sioc/ns#"
  xmlns:sioct="http://rdfs.org/sioc/types#"
  xmlns:skos="http://www.w3.org/2004/02/skos/core#"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"><!--<![endif]-->

I was able to get this working immediately, simply by adding xmlns:fb="http://www.facebook.com/2008/fbml" in an html.tpl.php template override in my subtheme, you can do the same in AT Commerce. I tested with IE8 and IE9, both worked fine. This took me about an hour because I had to go setup all this Facebook rubbish to test it. Frankly I hate Facebook, so this was not fun for me.

mubiesam’s picture

Now I got the point...

I had made a copy of html.tpl.php from adaptivetheme/at_core/templates/ to themes/at-commerce/templates, and tried to modify the code in at_commerce...but some how, this is wrong, the site is still using the code from adaptivetheme/at_core/templates/

So, after adding in at_core, the IE is working correctly, but supposedly I should not do this in at_core, how can I make it override in at-commerce...

p.s. Sorry to cost you an hour to do this, I don't like FB neither, but people here are quite crazy using it, it helps to promote the website, so still need to include...

Thanks,
Sam

Jeff Burnz’s picture

Probably you just need to clear the cache so Drupal see's the new template.

Jeff Burnz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.