<!--__FUEL_MARKER__0--> showing up in html

edited May 2014 in Share
We've added Facebook Open Graph markup to one of our sites: divvybikes.com but are having trouble with the default variables on the homepage.

In our header we have this code which will set the open graph variables if none are explicitly set elsewhere:
<meta property="og:image" content="<?=fuel_var('og_image', 'http://divvybikes.com/assets/images/chicago/Divvy-FB-blue.jpg') ?>" /> <meta property="og:title" content="<?=fuel_var('og_title', 'Meet Divvy') ?>" /> <meta property="og:description" content="<?=fuel_var('og_description', 'Divvy is your Chicago bike sharing system with thousands of bicycles available to you 24/7.') ?>" />
On every page besides the homepage when you do a view source the html comes out just fine like this (taken from the about page:http://divvybikes.com/about):
<meta property="og:image" content="http://divvybikes.com/assets/images/chicago/Divvy-FB-blue.jpg" /> <meta property="og:title" content="Meet Divvy" /> <meta property="og:description" content="Divvy is your Chicago bike sharing system with thousands of bicycles available to you 24/7." />
Or when we have a page we want to have specialized code which we set in the variables file
$pages['divvyweek'] = array('og_image' => 'http://www.divvybikes.com/assets/images/chicago/pages/divvy-week-2014.jpg', 'og_title' => 'April 21-27 is Divvy Week', 'og_description' => 'Divvy Week is a celebration of Chicago&#39;s newest transit system and the people who love it. We have a little something for everyone!');
such as the Divvyweek page (http://divvybikes.com/divvyweek) it also comes out fine.

<meta property="og:image" content="http://www.divvybikes.com/assets/images/chicago/pages/divvy-week-2014.jpg" /> <meta property="og:title" content="April 21-27 is Divvy Week" /> <meta property="og:description" content="Divvy Week is a celebration of Chicago&#39;s newest transit system and the people who love it. We have a little something for everyone!" />

But on the home page we get these Fuel Marker tags that mess up the OG when trying to post to Facebook, with the rendered html looking like this:

<meta property="og:image" content="<!--__FUEL_MARKER__0-->http://divvybikes.com/assets/images/chicago/Divvy-FB-blue.jpg" /> <meta property="og:title" content="<!--__FUEL_MARKER__1-->Meet Divvy" /> <meta property="og:description" content="<!--__FUEL_MARKER__2-->Divvy is your Chicago bike sharing system with thousands of bicycles available to you 24/7." />

Any suggestions?

Comments

  • edited 4:29PM
    That usually suggestions that the script stops execution during the rendering of the page before it can do the final cleanup of removing the inline editing fuel markers. Those markers are used to create span tags for inline editing and won't show up if you don't use fuel_var and instead just use the name of the variable (e.g. echo $my_var instead of echo fuel_var('my_var')).

    I'm curious why those markers are still there. Have you tried clearing the cache inside of FUEL? The Fuel_page class has a "fuelify" method that should "remove_markers" if you aren't logged in (line 1143 in the Fuel_pages.php file.)
  • edited 4:29PM
    I did try clearing the cache from the Fuel admin. No luck.

    We don't have a line 1143 in /fuel/modules/fuel/libraries/Fuel_page.php but we do have this code on line 471:

    _CI->config->item('admin_enabled', 'fuel') OR $this->variables('fuelified') === FALSE OR !$this->_fuelified OR empty($output) OR (defined('FUELIFY') AND FUELIFY === FALSE)) { return $this->remove_markers($output); }
  • edited 4:29PM
    Would there be a way to echo $my_var while still setting those default values?
  • edited 4:29PM
    What version of FUEL are you using?
  • edited 4:29PM
    0.9.3
  • edited 4:29PM
    If I set:

    define('USE_FUEL_MARKERS', FALSE);

    in the constants file what will it break?
  • edited 4:29PM
    That turns off inline editing from the front end but won't technically "break" anything.
Sign In or Register to comment.