Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    May 2012
    Posts
    42
    Plugin Contributions
    0

    Default facebook question

    Hi there, I'm using 1.5 (can't believe 1.51 is out even before I managed to get my new 1.5 up and running!)

    I want to use a facebook plugin which requires the following:
    <div class="fb-like" data-href="http://www.traditionalirishgifts.com" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div>

    The problem is that data-* attributes are invalid unless you are using the HTML5 doctype.

    Is it ok to change the doctype of zencart or does that cause loads of problems? Is there a better solution? I don't know much about doctypes!

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: facebook question

    1. If your template isn't built for HTML5, then don't go changing the doctype. The default template in Zen Cart v1.5.x and older is XHTML, which is a variant of HTML4. All your markup will be invalidated if you blindly change the doctype to HTML5 and don't go and update everything everywhere else in all the system's template files.

    2. There's nothing illegal about using that data-xxxx attribute even in XHTML, so if you must use facebook and if you must add that to your template, go ahead. You might still get a validation error, but it can be ignored.
    Better to ignore the "one" error specific to that line specific to a certain facebook plugin than to invalidate your entire site's template by changing the doctype.

    Have you actually tried it yet to see what the effects are?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: facebook question

    Hi thanks for the reply. I haven't tried changing it yet because I don't know much about doctypes. The template I'm using is just one I'm making myself.

    There's nothing overly fancy in it so I guess I'll go off and learn what the differences between html4 and html5 are and see if anything I'm using would cause problems. Thanks for the advice

    on a related issue, Facebook is also causing this error:
    cannot generate system identifier for general entity "appId"

    and it's to do with this line
    js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=144176452325042";
    having an unencoded ampersand. Is there an easy way to sort this out?

    Thanks again, I appreciate the help

  4. #4
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: facebook question

    Quote Originally Posted by crazysarah View Post
    Hi thanks for the reply. I haven't tried changing it yet because I don't know much about doctypes. The template I'm using is just one I'm making myself.

    There's nothing overly fancy in it so I guess I'll go off and learn what the differences between html4 and html5 are and see if anything I'm using would cause problems. Thanks for the advice
    I did NOT mean to go off and try changing the doctype.

    I meant to proceed with stuffing your facebook-specific code into your template, and watch it work ... without changing the doctype.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v139h Facebook like addon weird appearance on facebook activity
    By navido in forum General Questions
    Replies: 0
    Last Post: 7 Sep 2014, 06:34 PM
  2. v151 facebook scraper/google linter can't find my urls with Numinix Facebook Like
    By flernebunu in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Mar 2013, 11:25 AM
  3. Linking in Facebook question
    By NekkidFish in forum General Questions
    Replies: 8
    Last Post: 18 Nov 2012, 08:55 PM
  4. Facebook...yeah another question
    By Serious in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 14 Mar 2011, 10:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg