Coder Social home page Coder Social logo

magepal / magento1-fb-open-graph-meta-tags Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 4.0 5 KB

Facebook Open Graph Meta Tags Extension Magento1

Home Page: http://www.magepal.com

PHP 80.17% HTML 19.83%
facebook facebook-graph-api magento-extension magento-module magento1 open-graph

magento1-fb-open-graph-meta-tags's Introduction

magepal

MagePal Extensions - Install our extensions with confidence knowing that they will just work! But if you run into an issue... no problem, we normally solved all issues in 15 minutes or less.

magento1-fb-open-graph-meta-tags's People

Contributors

srenon avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

magento1-fb-open-graph-meta-tags's Issues

How to add the og:image to category page

Hi folks,
I am trying to include link of a category on facebook. The open graph object debugger shows that all category fields are correct but the og:image. This extension is missing adding the product.group option. I have tried to edit the block file (MagePal/FbOpenGraphMetaTags/Block/Tags.php) code in the getTags() function as follows but failed to get results:

public function getTags(){
$this->tags['og:url'] = $this->helper('core/url')->getCurrentUrl();
$this->tags['og:site_name'] = Mage::app()->getStore()->getName();
$this->tags['og:type'] = 'website';
$this->tags['og:title'] = $this->getLayout()->getBlock('head')->getTitle();
$this->tags['og:description'] = $this->getLayout()->getBlock('head')->getDescription();

//If on the product page
if($product = Mage::registry('current_product')){
$this->tags['og:type'] = 'product';
$this->tags['og:title'] = $product->getName();
$this->tags['og:description'] = $product->getShortDescription() ? $product->getShortDescription() : $this->tags['og:description'];
$this->tags['og:image'] = $this->helper('catalog/image')->init($product, 'image')->resize(500,500);
}
//If on the category page
elseif($category = Mage::registry('current_category')){
$this->tags['og:type'] = 'product.group';
$this->tags['og:title'] = $category->getName();
$this->tags['og:description'] = 'Helloooooooo';
$this->tags['og:image'] = 'https://images.askmen.com/1080x540/2016/01/14-045822-what_to_wear_in_your_tinder_pics.jpg';
}
foreach($this->getConfigValueArray() as $key => $value){
if(array_key_exists($key, $this->systemConfigTranslation)){
$this->tags[$this->systemConfigTranslation[$key]] = $value;
}
}

    return $this->tags;
}

I hope if anyone could help me to solve this issue!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.