ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Something wrong with template parsing during Facebook share?

February 28, 2011 4:18pm

Subscribe [5]
  • #1 / Feb 28, 2011 4:18pm

    Andru Edwards

    331 posts

    Not sure if this is as issue with just me, or something in EE in general. I have only see this on Facebook, but basically whenever someone shares something from the site, instead of pulling a summary, it just pulls “{body}” - is this a bug, or something wrong with how my templates are coded? Obviously they work fine in the browser when viewing the site directly! 😉

    Moved to CodeShare Corner by Moderator

  • #2 / Mar 01, 2011 4:00am

    Mark Bowen

    12637 posts

    I’m guessing this won’t be anything to do with ExpressionEngine directly as that function isn’t part of ExpressionEngine, rather code that you get from Facebook.

    That said what does the share button code look like that you’re using?

    Best wishes,

    Mark

  • #3 / Mar 01, 2011 2:01pm

    Andru Edwards

    331 posts

    Here’s the code - simple stuff. I just don’t get why Facebook is even seeing the {body} code. When they pull up the page, they should see the actual content since they don’t have direct access to the template, just the permalink URL:

    <iframe src="http://www.facebook.com/plugins/like.php?href={comment_url_title_auto_path}&layout=button_count&show_faces=false&width=70&action=like&font=segoe+ui&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:70px; height:25px"></iframe>
  • #4 / Mar 01, 2011 2:08pm

    Mark Bowen

    12637 posts

    Yep I can’t see anything in there that would do this however you’re not showing any of your surrounding code such as the weblog tag. I think you’re going to need to show some more of the template code in order to figure this one out.

    Also have you tried on a very much stripped down version of your page which has literally just the weblog entries tag and that Facebook code in it and nothing else? If it works then I would say there’s possibly something else going on in your template code somewhere but impossible to say without seeing it first though. Myself personally I’d try with a reduced template to see if the code will even work and if it does then either build the template back up again or take a really really good look at the full page template code.

    Best wishes,

    Mark

  • #5 / Mar 02, 2011 10:29am

    Sue Crocker

    26054 posts

    Hi, Andru.

    This is a bit beyond the scope of regular EE support - how are you building the Facebook entries? I use RSS Graffiti to publish to Facebook.

    Moving to the CodeShare Corner for additional community support.

  • #6 / Mar 06, 2011 3:47am

    Adam Khan

    319 posts

    RSS Graffiti—cool, thanks for the heads-up!

  • #7 / Mar 06, 2011 5:36am

    Andru Edwards

    331 posts

    This isn’t me pushing to Facebook through RSS, this is when someone clicks the Like button on one of our posts (code in a previous post in this thread) - Facebook then scans the page for title, URL, and a snippet of the entry. It finds all three, but for whatever reason, it sees {body} instead of the actual entry of the post, and have no clue why, since Facebook shouldn’t be seeing the template code.

  • #8 / Mar 06, 2011 8:12am

    Mark Bowen

    12637 posts

    Did you try a stripped down template to see what’s going on?

    Best wishes,

    Mark

  • #9 / May 10, 2011 7:59am

    Patrick Hvid

    62 posts

    I have the exact same problem!

    If I (or someone else) shares a post on my weblog the only thing facebook “sees” is the static heading text (which might come from a channel) and the static footer text.
    Anything which is in the blogroll is hidden from facebook, regardless if I publish the roll itself or the one post.
    (noted is that the “single post” page is in fact a blogroll,

    {exp:channel:entries channel="....

    and perhaps that could be done in some other way?)

  • #10 / May 10, 2011 12:14pm

    Patrick Hvid

    62 posts

    I have the exact same problem!

    If I (or someone else) shares a post on my weblog the only thing facebook “sees” is the static heading text (which might come from a channel) and the static footer text.
    Anything which is in the blogroll is hidden from facebook, regardless if I publish the roll itself or the one post.
    (noted is that the “single post” page is in fact a blogroll, and perhaps that could be done in some other way?)

    Nevermind my comment above, I solved my part of the problem with sending OG-metadata to facebook..
    A complicated matter since I have a separate html-header page, but something like this:

    In the html header:

    <meta property="og:description" content="{embed:page_content}"/>

    on the page itself:

    {embed="embeds/html_header" page_content="{exp:channel:entries channel="patricks_blogg"}{exp:eehive_hacksaw words="50"}{exp:low_replace find="<p>|</p>" replace="" multiple="yes"}{entry}{/exp:low_replace}{/exp:eehive_hacksaw} {/exp:channel:entries}"}

    Note that I needed to use both “ee_hive_hacksaw” to minimize number of words in the meta, and also “low_replace_find” to rempve tags until I got it working seamless.

    /patrick

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases