guy_dba Posted September 14, 2022 Share Posted September 14, 2022 Hello, I replaced the breacrumb.tpl but not sure how immediate it will effect the results. I cleared cache and tried but Google Search still giving me 19 pages with following errors <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="https://barcodestripe.com/en/25-id-card-printers" title="ID Card Printers" ><span itemprop="title">ID Card Printers</span></a></span> Link to comment Share on other sites More sharing options...
the.rampage.rado Posted April 15, 2023 Share Posted April 15, 2023 @Daresh, when using the last .tpl file I receive the following warning: The line in question is: if (!empty($_smarty_tpl->tpl_vars['path']->value)) { $_smarty_tpl->_assignInScope('matchCount', preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/',$_smarty_tpl->tpl_vars['path']->value,$_smarty_tpl->tpl_vars['matches']->value)); $_smarty_tpl->_assignInScope('breadcrumbs', array()); $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable(null, $_smarty_tpl->isRenderingCache); $_smarty_tpl->tpl_vars['i']->value = 0; (second one) What should I change? Otherwise the file is workign excelent! Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 Hello Daresh, I installed your code in prestashop 1.6 (themes/ breadcrumbs.tpl) however when google try to validate the fix, found some errors like still appears the data-vocabulary and the name of the product doesn't show up in the code. Please look at the snipped shot. Thank you in advannce for your help. Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 The new file does not contain "data-vocabulary" at all so you either replaced a wrong file, or maybe your cache still holds the old contents. Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 Thank you for your reply. this is the code that I installed <!-- Breadcrumb --> {if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if} {if !empty($path)} {$matchCount = preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/', $path, $matches)} {$breadcrumbs = []} {for $i=0; $i < $matchCount; $i++} {$breadcrumbs[] = ['url' => $matches[1][$i], 'title' => $matches[2][$i]]} {/for} {$match = preg_match('/>([^<]+)(?:<\/\\w+>s*)?$/', $path, $matches)} {if !empty($matches[1])} {$breadcrumbs[] = ['url' => '', 'title' => $matches[1]]} {elseif !$match && !$matchCount} {$breadcrumbs[] = ['url' => '', 'title' => $path]} {/if} {/if} <div class="clearfix"> <ol class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a class="home" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Return to Home'}" itemprop="item"> <i class="icon-home"></i> </a> <meta itemprop="name" content="{l s='Home'}" /> <meta itemprop="position" content="1" /> </li> {if !empty($breadcrumbs)} {foreach from=$breadcrumbs item=breadcrumb name=crumbs} <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> {if !empty($breadcrumb.url)} <a href="{$breadcrumb.url}" itemprop="item" title="{$breadcrumb.title}"> <span itemprop="name">{$breadcrumb.title}</span> </a> {else} <span itemprop="name">{$breadcrumb.title}</span> {/if} <meta itemprop="position" content="{($smarty.foreach.crumbs.iteration|intval + 1)}" /> </li> {/foreach} {/if} </ol> </div> {if isset($smarty.get.search_query) && isset($smarty.get.results) && $smarty.get.results > 1 && isset($smarty.server.HTTP_REFERER)} <div class="pull-right"> <strong> {capture}{if isset($smarty.get.HTTP_REFERER) && $smarty.get.HTTP_REFERER}{$smarty.get.HTTP_REFERER}{elseif isset($smarty.server.HTTP_REFERER) && $smarty.server.HTTP_REFERER}{$smarty.server.HTTP_REFERER}{/if}{/capture} <a href="{$smarty.capture.default|escape:'html':'UTF-8'|secureReferrer|regex_replace:'/[\?|&]content_only=1/':''}" name="back"> <i class="icon-chevron-left left"></i> {l s='Back to Search results for "%s" (%d other results)' sprintf=[$smarty.get.search_query,$smarty.get.results]} </a> </strong> </div> {/if} <!-- /Breadcrumb --> Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 this is the code from your post Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 It's not about the code, but where did you put it and do you see the change in your store code before sumbitting it to Google. Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 2 minutes ago, Daresh said: It's not about the code, but where did you put it and do you see the change in your store code before sumbitting it to Google. I installed in the folder themes/breadcrumbs.tpl ----------------It is wrong place? Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 In the default theme, it's themes/default-bootstrap/breadcrumb.tpl Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 yes, I installed there and before that I check your code with schema.org because I was redirected from your posted link on google to there and your code is fine. I replaced the Themes/default-bootstrap/breadcrumb.tpl with your code , then I saved the changes and clear the cache in the back office. and then submitted the fix to google and this morning I got the message with the error. Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 Please share a link to your store. Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 https://www.justpliers.com/ Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 You till have some old code in the footer, some mess in the theme I suppose Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 oh... Thank you for your kind reply. In which page did you find that? I don't see it.... how can I fix that old code in the footer? any suggestion? Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 It's on every page, but hidden in the code. Hard to tell where it is because you have some modules there, you need to search your theme files. Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 thank you....suggestion for terms to look on those pages? and how to remove them? if I found them first....lol Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 Look for 'vocabulary'. Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 after look for the term I have to replace them with the schema.org? If I change the theme? it will fix the issues? Link to comment Share on other sites More sharing options...
Daresh Posted November 15, 2023 Author Share Posted November 15, 2023 No, remove it. Link to comment Share on other sites More sharing options...
nassry Posted November 15, 2023 Share Posted November 15, 2023 thsnk you Link to comment Share on other sites More sharing options...
Artunj Posted January 14 Share Posted January 14 Hi, thank you for your solution. Now Google Search Console accepted the verification process. Just would like to check how to remove the third slash "/" ? Here is the code: {* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <!-- Breadcrumb --> <div class="breadcrumb_container"> <div class="container"> {if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if} {if !empty($path)} {$matchCount = preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/', $path, $matches)} {$breadcrumbs = []} {for $i=0; $i < $matchCount; $i++} {$breadcrumbs[] = ['url' => $matches[1][$i], 'title' => $matches[2][$i]]} {/for} {$match = preg_match('/>([^<]+)(?:<\/\\w+>s*)?$/', $path, $matches)} {if !empty($matches[1])} {$breadcrumbs[] = ['url' => '', 'title' => $matches[1]]} {elseif !$match && !$matchCount} {$breadcrumbs[] = ['url' => '', 'title' => $path]} {/if} {/if} <div class="clearfix"> <ol class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a class="home" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Return to Home'}" itemprop="item"> <i class="icon-home"></i> </a> <meta itemprop="name" content="{l s='Home'}" /> <meta itemprop="position" content="1" /> </li> {if !empty($breadcrumbs)} {foreach from=$breadcrumbs item=breadcrumb name=crumbs} <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> {if !empty($breadcrumb.url)} <a href="{$breadcrumb.url}" itemprop="item" title="{$breadcrumb.title}"> <span itemprop="name">{$breadcrumb.title}</span> </a> {else} <span itemprop="name">{$breadcrumb.title}</span> {/if} <meta itemprop="position" content="{($smarty.foreach.crumbs.iteration|intval + 1)}" /> </li> {/foreach} {/if} </ol> </div> {if isset($smarty.get.search_query) && isset($smarty.get.results) && $smarty.get.results > 1 && isset($smarty.server.HTTP_REFERER)} <div class="pull-right"> <strong> {capture}{if isset($smarty.get.HTTP_REFERER) && $smarty.get.HTTP_REFERER}{$smarty.get.HTTP_REFERER}{elseif isset($smarty.server.HTTP_REFERER) && $smarty.server.HTTP_REFERER}{$smarty.server.HTTP_REFERER}{/if}{/capture} <a href="{$smarty.capture.default|escape:'html':'UTF-8'|secureReferrer|regex_replace:'/[\?|&]content_only=1/':''}" name="back"> <i class="icon-chevron-left left"></i> {l s='Back to Search results for "%s" (%d other results)' sprintf=[$smarty.get.search_query,$smarty.get.results]} </a> </strong> </div> {/if} </div> </div> <!-- /Breadcrumb --> Link to comment Share on other sites More sharing options...
Artunj Posted January 19 Share Posted January 19 Hi. I would like to inform you that this solution destroys the content of the website. Now my blog content is unvisible. So be careful. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now