Jump to content

Добавление ссылки канонических URL


Recommended Posts

2.  когда на странице "Мобильные телефоны" выбираешь бренд какой-либо, каноническая ссылка не меняется. Т.е. адрес страницы такой: название_сайта/catalog/mobilnye-telefony/sony, а каноническая такая: название_сайта/catalog/mobilnye-telefony.

 

Видимо, у Вас  свои доработки, потому как на демо-сайте совсем не так...

В этом плане доработок не было. А по первому вопросу есть идеи?

Link to post
Share on other sites
  • 5 months later...
  • 3 weeks later...

А чем вам не нравиться стандартное решение? 

{* Канонический адрес страницы *}
{if $category && $brand}
{$canonical="/catalog/{$category->url}/{$brand->url}" scope=parent}
{elseif $category}
{$canonical="/catalog/{$category->url}" scope=parent}
{elseif $brand}
{$canonical="/brands/{$brand->url}" scope=parent}
{elseif $keyword}
{$canonical="/products?keyword={$keyword|escape}" scope=parent}
{else}
{$canonical="/products" scope=parent}
{/if}

Чтоб при выборе бренда в категории каноническим оставался только адрес бренда, нужно изменить 3ю строку, да и все или я что-то не так понял?

{* Канонический адрес страницы *}
{if $category && $brand}
{$canonical="/catalog/{$category->url}" scope=parent}
{elseif $category}
{$canonical="/catalog/{$category->url}" scope=parent}
{elseif $brand}
{$canonical="/brands/{$brand->url}" scope=parent}
{elseif $keyword}
{$canonical="/products?keyword={$keyword|escape}" scope=parent}
{else}
{$canonical="/products" scope=parent}
{/if}
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...