View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006217 | OXID eShop (all versions) | 4.09. SEO, SEO URL | public | 2015-08-14 12:33 | 2025-07-23 10:08 |
| Reporter | wiedeking | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | won't fix | ||
| Product Version | 4.9.5 / 5.2.5 | ||||
| Summary | 0006217: og:url wrong for CMS Pages | ||||
| Description | The meta tag og:url for CMS Pages (better: not product pages) is wrong. It is always the currentHomeDir instead of the currect URL. e.g. www.demoshop.de/news This is the base.tpl of the azure theme. ------------- CODE ------------ [{if $oViewConf->getFbAppId()}] <meta property="og:site_name" content="[{$oViewConf->getBaseDir()}]"> <meta property="fb:app_id" content="[{$oViewConf->getFbAppId()}]"> <meta property="og:title" content="[{ $_sMetaTitlePrefix }][{if $_sMetaTitlePrefix && $_sMetaTitle }] | [{/if}][{$_sMetaTitle|strip_tags}][{if $_sMetaTitleSuffix && ($_sMetaTitlePrefix || $_sMetaTitle) }] | [{/if}][{$_sMetaTitleSuffix}] [{if $_sMetaTitlePageSuffix }] | [{ $_sMetaTitlePageSuffix }] [{/if}]"> [{if $oViewConf->getActiveClassName() == 'details' }] <meta property="og:type" content="product"> <meta property="og:image" content="[{$oView->getActPicture()}]"> <meta property="og:url" content="[{$oView->getCanonicalUrl()}]"> [{else}] <meta property="og:type" content="website"> <meta property="og:image" content="[{$oViewConf->getImageUrl('tuetenbeispiel.jpg')}]"> <meta property="og:url" content="[{$oViewConf->getCurrentHomeDir()}]"> [{/if}] [{/if}] ------------- CODE ------------ In the ELSE branch it always assigns getCurrentHomeDir to the og:url. But here it must be the correct url to the cms page. e.g. www.myurl.de/news. you can test the meta tags with facebook: https://developers.facebook.com/tools/debug/ | ||||
| Steps To Reproduce | open your demoshop/news http://demoshop.oxid-esales.com/professional-edition/news/ In sourcecode search for og:url (meta property="og:url" is not correct) <meta property="og:url" content="http://demoshop.oxid-esales.com/professional-edition/"> correct would be: <meta property="og:url" content="http://demoshop.oxid-esales.com/professional-edition/news/> | ||||
| Tags | SEO Rewrite, Solution Provided | ||||
| Theme | Azure | ||||
| Browser | Not defined | ||||
| PHP Version | Not defined | ||||
| Database Version | Not defined | ||||
|
|
Proposed solution from the community forum:
[{if $oViewConf->getActiveClassName() == 'details' }]
<meta property="og:type" content="product">
<meta property="og:image" content="[{$oView->getActPicture()}]">
<meta property="og:url" content="[{$oView->getCanonicalUrl()}]">
[{elseif $oContent}]
<meta property="og:type" content="website">
<meta property="og:image" content="[{$oViewConf->getImageUrl('basket.png')}]">
<meta property="og:url" content="[{$oContent->getLink()}]">
[{else}]
<meta property="og:type" content="website">
<meta property="og:image" content="[{$oViewConf->getImageUrl('basket.png')}]">
<meta property="og:url" content="[{$oViewConf->getCurrentHomeDir()}]">
[{/if}]
http://forum.oxid-esales.com/showthread.php?p=162060#post162109 |
|
|
This was related to Facebook and moved to Application/views/blocks/azure/head_meta_open_graph.tpl in https://github.com/OXIDprojects/facebook-social-plugins-module |