Sunday, September 18, 2016

Facebook Open Graph for Osclass


My team of developer are upgrading our online market places which using osclass cms. After we are done, we found the the theme doesn't header dont have meta for facebook open graph to display title, description and image. I found solution here, which you need to open the \oc-content\themes\YOUR-THEME-NAME\common\head.php file and paste the code below
<meta property="og:title" content="<?php echo osc_item_title() ; ?>" />
<meta property="og:description" content="<?php echo osc_highlight(strip_tags(osc_item_description()), 140) ; ?>" />
<?php if( osc_count_item_resources() > 0 ) { ?>
<meta property="og:image" content="<?php echo osc_resource_url(); ?>" />
<?php } else { ?>
<meta property="og:image" content="PUT-YOUR-DEFAULT-IMAGE-HERE" />
<?php } ?>