Version Notes
Initial release.
Download this release
Release Info
Developer | Damir Perkosan |
Extension | Naya_OpenGraph |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Naya/Base/Helper/Data.php +5 -0
- app/code/community/Naya/Base/etc/config.xml +40 -0
- app/code/community/Naya/Base/etc/system.xml +9 -0
- app/code/community/Naya/OpenGraph/Block/Opengraph.php +11 -0
- app/code/community/Naya/OpenGraph/Helper/Data.php +5 -0
- app/code/community/Naya/OpenGraph/etc/adminhtml.xml +22 -0
- app/code/community/Naya/OpenGraph/etc/config.xml +52 -0
- app/code/community/Naya/OpenGraph/etc/system.xml +44 -0
- app/design/frontend/base/default/layout/naya_opengraph.xml +9 -0
- app/design/frontend/base/default/template/naya/opengraph/products.phtml +14 -0
- app/etc/modules/Naya_Base.xml +12 -0
- app/etc/modules/Naya_OpenGraph.xml +12 -0
- app/locale/en_US/Naya_Base.csv +0 -0
- app/locale/en_US/Naya_OpenGraph.csv +0 -0
- package.xml +18 -0
app/code/community/Naya/Base/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Naya_Base_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
+
|
4 |
+
|
5 |
+
}
|
app/code/community/Naya/Base/etc/config.xml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Naya_Base>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Naya_Base>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<helpers>
|
11 |
+
<naya_base>
|
12 |
+
<class>Naya_Base_Helper</class>
|
13 |
+
</naya_base>
|
14 |
+
</helpers>
|
15 |
+
</global>
|
16 |
+
|
17 |
+
<adminhtml>
|
18 |
+
<translate>
|
19 |
+
<modules>
|
20 |
+
<Naya_Base>
|
21 |
+
<files>
|
22 |
+
<default>Naya_Base.csv</default>
|
23 |
+
</files>
|
24 |
+
</Naya_Base>
|
25 |
+
</modules>
|
26 |
+
</translate>
|
27 |
+
</adminhtml>
|
28 |
+
|
29 |
+
<frontend>
|
30 |
+
<translate>
|
31 |
+
<modules>
|
32 |
+
<Naya_Base>
|
33 |
+
<files>
|
34 |
+
<default>Naya_Base.csv</default>
|
35 |
+
</files>
|
36 |
+
</Naya_Base>
|
37 |
+
</modules>
|
38 |
+
</translate>
|
39 |
+
</frontend>
|
40 |
+
</config>
|
app/code/community/Naya/Base/etc/system.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<naya translate="label" module="naya_base">
|
5 |
+
<label>Naya</label>
|
6 |
+
<sort_order>2000</sort_order>
|
7 |
+
</naya>
|
8 |
+
</tabs>
|
9 |
+
</config>
|
app/code/community/Naya/OpenGraph/Block/Opengraph.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Naya_OpenGraph_Block_Opengraph extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function getAppId(){
|
5 |
+
return Mage::getStoreConfig('naya_opengraph/general/site_id');
|
6 |
+
}
|
7 |
+
|
8 |
+
public function getAdminId(){
|
9 |
+
return Mage::getStoreConfig('naya_opengraph/general/admin_id');
|
10 |
+
}
|
11 |
+
}
|
app/code/community/Naya/OpenGraph/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Naya_OpenGraph_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
+
|
4 |
+
|
5 |
+
}
|
app/code/community/Naya/OpenGraph/etc/adminhtml.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<naya_opengraph translate="title" module="naya_opengraph">
|
12 |
+
<title>Open graph</title>
|
13 |
+
</naya_opengraph>
|
14 |
+
</children>
|
15 |
+
</config>
|
16 |
+
</children>
|
17 |
+
</system>
|
18 |
+
</children>
|
19 |
+
</admin>
|
20 |
+
</resources>
|
21 |
+
</acl>
|
22 |
+
</config>
|
app/code/community/Naya/OpenGraph/etc/config.xml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Naya_OpenGraph>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Naya_OpenGraph>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<blocks>
|
11 |
+
<naya_opengraph>
|
12 |
+
<class>Naya_OpenGraph_Block</class>
|
13 |
+
</naya_opengraph>
|
14 |
+
</blocks>
|
15 |
+
<helpers>
|
16 |
+
<naya_opengraph>
|
17 |
+
<class>Naya_OpenGraph_Helper</class>
|
18 |
+
</naya_opengraph>
|
19 |
+
</helpers>
|
20 |
+
</global>
|
21 |
+
|
22 |
+
<adminhtml>
|
23 |
+
<translate>
|
24 |
+
<modules>
|
25 |
+
<Naya_OpenGraph>
|
26 |
+
<files>
|
27 |
+
<default>Naya_OpenGraph.csv</default>
|
28 |
+
</files>
|
29 |
+
</Naya_OpenGraph>
|
30 |
+
</modules>
|
31 |
+
</translate>
|
32 |
+
</adminhtml>
|
33 |
+
|
34 |
+
<frontend>
|
35 |
+
<layout>
|
36 |
+
<updates>
|
37 |
+
<naya_opengraph>
|
38 |
+
<file>naya_opengraph.xml</file>
|
39 |
+
</naya_opengraph>
|
40 |
+
</updates>
|
41 |
+
</layout>
|
42 |
+
<translate>
|
43 |
+
<modules>
|
44 |
+
<Naya_OpenGraph>
|
45 |
+
<files>
|
46 |
+
<default>Naya_OpenGraph.csv</default>
|
47 |
+
</files>
|
48 |
+
</Naya_OpenGraph>
|
49 |
+
</modules>
|
50 |
+
</translate>
|
51 |
+
</frontend>
|
52 |
+
</config>
|
app/code/community/Naya/OpenGraph/etc/system.xml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<naya_opengraph translate="label" module="naya_opengraph">
|
5 |
+
<class>separator-top</class>
|
6 |
+
<label>Open graph</label>
|
7 |
+
<tab>naya</tab>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>100</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<groups>
|
14 |
+
<general translate="label" module="naya_opengraph">
|
15 |
+
<label>General settings</label>
|
16 |
+
<sort_order>1</sort_order>
|
17 |
+
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>1</show_in_website>
|
19 |
+
<show_in_store>1</show_in_store>
|
20 |
+
<fields>
|
21 |
+
<site_id translate="label">
|
22 |
+
<label>ID of your site</label>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>1</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<comment><![CDATA[<a href="http://developers.facebook.com/setup/" target="_bank">Register here</a>]]></comment>
|
29 |
+
</site_id>
|
30 |
+
<admin_id translate="label">
|
31 |
+
<label>Admin ID</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<sort_order>2</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
<comment><![CDATA[<a href="http://findmyfacebookid.com/" target="_bank">Find admin ID</a>]]></comment>
|
38 |
+
</admin_id>
|
39 |
+
</fields>
|
40 |
+
</general>
|
41 |
+
</groups>
|
42 |
+
</naya_opengraph>
|
43 |
+
</sections>
|
44 |
+
</config>
|
app/design/frontend/base/default/layout/naya_opengraph.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<layout>
|
4 |
+
<catalog_product_view>
|
5 |
+
<reference name="head">
|
6 |
+
<block type="naya_opengraph/opengraph" name="naya.open.graph.products" as="naya_open_graph_products" template="naya/opengraph/products.phtml" />
|
7 |
+
</reference>
|
8 |
+
</catalog_product_view>
|
9 |
+
</layout>
|
app/design/frontend/base/default/template/naya/opengraph/products.phtml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $product = Mage::registry('current_product');?>
|
2 |
+
<?php if ((string)$this->getAppId() != ''): ?>
|
3 |
+
<meta property='fb:app_id' content='<?php echo (string)$this->getAppId(); ?>'/>
|
4 |
+
<?php endif;?>
|
5 |
+
<?php if ((string)$this->getAdminId() != ''): ?>
|
6 |
+
<meta property='fb:admins' content='<?php echo (string)$this->getAdminId(); ?>' />
|
7 |
+
<?php endif;?>
|
8 |
+
<meta property='og:url' content='<?php echo $product->getProductUrl();?>'/>
|
9 |
+
<meta property='og:type' content='product'/>
|
10 |
+
<meta property='og:title' content='<?php echo trim(strip_tags(str_replace("'", "", $product->getName()))); ?>'/>
|
11 |
+
<meta property='og:description' content='<?php echo trim(strip_tags(str_replace("'", "", $product->getShortDescription()))); ?>'>
|
12 |
+
<?php foreach ($product->getMediaGallery('images') as $_image): ?>
|
13 |
+
<meta property='og:image' content='<?php echo Mage::helper('catalog/image')->init($product, 'image', $_image['file']);?>'/>
|
14 |
+
<?php endforeach;?>
|
app/etc/modules/Naya_Base.xml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Naya_Base>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<depends>
|
8 |
+
<Mage_Core />
|
9 |
+
</depends>
|
10 |
+
</Naya_Base>
|
11 |
+
</modules>
|
12 |
+
</config>
|
app/etc/modules/Naya_OpenGraph.xml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Naya_OpenGraph>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<depends>
|
8 |
+
<Mage_Core />
|
9 |
+
</depends>
|
10 |
+
</Naya_OpenGraph>
|
11 |
+
</modules>
|
12 |
+
</config>
|
app/locale/en_US/Naya_Base.csv
ADDED
File without changes
|
app/locale/en_US/Naya_OpenGraph.csv
ADDED
File without changes
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Naya_OpenGraph</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Add Open Graph tags in your product pages and generate previews when your content is shared on Facebook.</summary>
|
10 |
+
<description>This extension includes Open Graph tags in your product page HTML and allow the Facebook Crawler to generate previews when your content is shared on Facebook.</description>
|
11 |
+
<notes>Initial release.</notes>
|
12 |
+
<authors><author><name>Damir Perkosan</name><user>dperkosan</user><email>dperkosan@gmail.com</email></author></authors>
|
13 |
+
<date>2014-10-08</date>
|
14 |
+
<time>09:18:52</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Naya"><dir name="Base"><dir name="Helper"><file name="Data.php" hash="c8e570f1b43c26fc283c671d08500b73"/></dir><dir name="etc"><file name="config.xml" hash="f8e52dc85832a20709958cca13402daa"/><file name="system.xml" hash="19d728b32254cae1eb3b0a89b0b3a1f4"/></dir></dir><dir name="OpenGraph"><dir name="Block"><file name="Opengraph.php" hash="2f451cd81a18124aa3e12acf088462af"/></dir><dir name="Helper"><file name="Data.php" hash="66b291fc9ebb4645e7644664889c08c1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7add2998ef7062992916c05979b51b8e"/><file name="config.xml" hash="0da1f3c1869617520147d00e95a8377a"/><file name="system.xml" hash="541c2665c2e1db6ec8b8c12549b91948"/></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Naya_Base.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Naya_OpenGraph.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Naya_Base.xml" hash="5a34d072400c7079ce8f79e3d288b7e8"/><file name="Naya_OpenGraph.xml" hash="f98cd6beae4d1d723a7ee5ab6938569d"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="naya_opengraph.xml" hash="f06d365927c458f5ff18798bca659fe5"/></dir><dir name="template"><dir name="naya"><dir name="opengraph"><file name="products.phtml" hash="439f0f9cb57efae7f41a687cde92a44f"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|