1:{if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if} 2: 3:{if isset($path) && !empty($path)} 4: {* Extract bradcrumb links from anchors *} 5: {$matches = []} 6: {$matchCount = preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/', $path, $matches)} 7: {$breadcrumbs = []} 8: {for $i=0; $i<$matchCount; $i++} 9: {$breadcrumbs[] = ['url' => $matches[1][$i], 'title' => $matches[2][$i]]} 10: {/for} 11: 12: {* Extract the last breadcrumb which is not link, it's plain text or text inside span *} 13: {$match = preg_match('/>([^<]+)(?:<\/\w+>\s*)?$/', $path, $matches)} 14: {if !empty($matches[1])} 15: {$breadcrumbs[] = ['url' => '', 'title' => $matches[1]]} 16: {elseif !$match && !$matchCount} 17: {$breadcrumbs[] = ['url' => '', 'title' => $path]} 18: {/if} 19:{/if} 20: 21:<ol class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"> 22: <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> 23: <a href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Home Page'}" itemprop="item"> 24: <span itemprop="name">{l s='Home'}</span> 25: </a> 26: <meta itemprop="position" content="1"> 27: </li> 28: {if !empty($breadcrumbs)} 29: {foreach from=$breadcrumbs item=breadcrumb name=crumbs} 30: <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> 31: {if isset($breadcrumb.url)} 32: <a href="{$breadcrumb.url}" itemprop="item"> 33: <span itemprop="name">{$breadcrumb.title}</span> 34: </a> 35: {else} 36: <a href="#" title="{$breadcrumb.title}" itemprop="item"> 37: <span itemprop="name">{$breadcrumb.title}</span> 38: </a> 39: {/if} 40: <meta itemprop="position" content="{($smarty.foreach.crumbs.iteration|intval + 1)}"> 41: </li> 42: {/foreach} 43: {/if} 44:</ol> 45: 46:{if isset($smarty.get.search_query) && isset($smarty.get.results) && $smarty.get.results > 1 && isset($smarty.server.HTTP_REFERER)} 47: <nav> 48: <ul class="pager"> 49: <li class="previous"> 50: {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} 51: <a href="{$smarty.capture.default|escape:'html':'UTF-8'|secureReferrer|regex_replace:'/[\?|&]content_only=1/':''}" name="back"> 52: <span> 53: {if $isRtl}<i class="icon icon-angle-right"></i>{else}<i class="icon icon-angle-left"></i>{/if} {l s='Back to Search results for "%s" (%d other results)' sprintf=[$smarty.get.search_query,$smarty.get.results]} 54: </span> 55: </a> 56: </li> 57: </ul> 58: </nav> 59:{/if}