View Issue Details

IDProjectCategoryView StatusLast Update
0006217OXID eShop (all versions)4.09. SEO, SEO URLpublic2024-02-14 10:47
Reporterwiedeking Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version4.9.5 / 5.2.5 
Summary0006217: og:url wrong for CMS Pages
DescriptionThe 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 Reproduceopen 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/>
TagsSEO Rewrite, Solution Provided
ThemeAzure
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

QA

2015-08-19 17:21

administrator   ~0011168

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