iMessi89 Posted March 25, 2013 Report Share Posted March 25, 2013 надо нет в симпле реализовывать для гугла? или с пагинацией проблем не возникнет? Quote Link to post Share on other sites
SV911 Posted March 25, 2013 Report Share Posted March 25, 2013 Не знаю нада или нет. Но у себя реализовал на всякий случай ) Quote Link to post Share on other sites
iMessi89 Posted March 25, 2013 Author Report Share Posted March 25, 2013 закежь сайт - посмотрю как выглядит)) Quote Link to post Share on other sites
iMessi89 Posted March 25, 2013 Author Report Share Posted March 25, 2013 можно в личку) Quote Link to post Share on other sites
SV911 Posted March 25, 2013 Report Share Posted March 25, 2013 hlopok.com.ua Quote Link to post Share on other sites
iMessi89 Posted March 25, 2013 Author Report Share Posted March 25, 2013 {* rel=next|prev для гугла *} {if $total_pages_num > 1} {if $current_page_num == 1} <link rel="next" href="{url page=2}" /> {elseif $current_page_num == $total_pages_num} <link rel="prev" href="{url page=$current_page_num-1}" /> {else} <link rel="prev" href="{url page=$current_page_num-1}" /> <link rel="next" href="{url page=$current_page_num+1}" /> {/if} {/if}Но проблема в том. что ссылки с page=1 не существует!!!!! и в результате для страницы с page=2 алгоритм работы срикпта выдает<link rel="prev" href="/atc/catalog/workstation?page=1" />хотя в симпле страницы с параметром page=1 нету!!!!! Первая страница она же главная без параметра page!!! Что делать?? :o3 Quote Link to post Share on other sites
iMessi89 Posted March 25, 2013 Author Report Share Posted March 25, 2013 {if $total_pages_num > 1} {if $current_page_num == 1} <link rel="next" href="{url page=2}" /> {elseif $current_page_num == $total_pages_num} <link rel="prev" href="{url page=$current_page_num-1}" /> {else} <link rel="prev" href="{url page=$current_page_num-1}" /> <link rel="next" href="{url page=$current_page_num+1}" /> {/if} {/if} Quote Link to post Share on other sites
iMessi89 Posted March 25, 2013 Author Report Share Posted March 25, 2013 блин а че не дает вставить html код??? Quote Link to post Share on other sites
iMessi89 Posted March 25, 2013 Author Report Share Posted March 25, 2013 {if $total_pages_num > 1} {if $current_page_num == 1} <link rel="next" href="{url page=2}" /> {elseif $current_page_num == $total_pages_num} <link rel="prev" href="{url page=$current_page_num-1}" /> {else} <link rel="prev" href="{url page=$current_page_num-1}" /> <link rel="next" href="{url page=$current_page_num+1}" /> {/if} {/if} Quote Link to post Share on other sites
tsybart Posted July 24, 2015 Report Share Posted July 24, 2015 кто подскажите как выводить ссылку на первую страницу без ?page=1 Quote Link to post Share on other sites
Noxter Posted July 24, 2015 Report Share Posted July 24, 2015 кто подскажите как выводить ссылку на первую страницу без ?page=1Откройте файл design/default/html/pagination.tpl там найдете решение. Quote Link to post Share on other sites
tsybart Posted July 24, 2015 Report Share Posted July 24, 2015 (edited) удалить Edited July 24, 2015 by tsybart Quote Link to post Share on other sites
tsybart Posted July 24, 2015 Report Share Posted July 24, 2015 Откройте файл design/default/html/pagination.tpl там найдете решение. спасибо, код получился куда лучше! Quote Link to post Share on other sites
Dmitry86 Posted October 16, 2016 Report Share Posted October 16, 2016 {if $total_pages_num > 1} {if $current_page_num == 1} <link rel="next" href="{url page=2}" /> {elseif $current_page_num == $total_pages_num} <link rel="prev" href="{url page=$current_page_num-1}" /> {else} <link rel="prev" href="{url page=$current_page_num-1}" /> <link rel="next" href="{url page=$current_page_num+1}" /> {/if} {/if} Всё решение, как писал Noxter: {if $current_page_num==2}<link rel="prev" href="{url page=null}">{/if} {if $current_page_num>2}<link rel="prev" href="{url page=$current_page_num-1}">{/if} {if $current_page_num<$total_pages_num}<link rel="next" href="{url page=$current_page_num+1}">{/if} Просто вставляете между <head>..</head> Quote Link to post Share on other sites
Noxter Posted October 16, 2016 Report Share Posted October 16, 2016 Всё решение, как писал Noxter: {if $current_page_num==2}<link rel="prev" href="{url page=null}">{/if} {if $current_page_num>2}<link rel="prev" href="{url page=$current_page_num-1}">{/if} {if $current_page_num<$total_pages_num}<link rel="next" href="{url page=$current_page_num+1}">{/if} Просто вставляете между <head>..</head>Где я это писал? Quote Link to post Share on other sites
Dmitry86 Posted October 19, 2016 Report Share Posted October 19, 2016 Где я это писал?вот тут написано было: Откройте файл design/default/html/pagination.tpl там найдете решение. отсюда и взято решение. Quote Link to post Share on other sites
Noxter Posted October 19, 2016 Report Share Posted October 19, 2016 вот тут написано было: отсюда и взято решение.Ну так не я же его придумал, а лишь направил куда копать. Quote Link to post Share on other sites
Dmitry86 Posted October 19, 2016 Report Share Posted October 19, 2016 Ну так не я же его придумал, а лишь направил куда копать.ну вот за наводку спасибо) Quote Link to post Share on other sites
Noxter Posted October 19, 2016 Report Share Posted October 19, 2016 ну вот за наводку спасибо)Да тю, всегда пожалуйста) Quote Link to post Share on other sites
Volnorez Posted March 15, 2018 Report Share Posted March 15, 2018 hlopok.com.uaЗдравствуйте, {if $current_page_num==2}<link rel="prev" href="{url page=null}">{/if} {if $current_page_num>2}<link rel="prev" href="{url page=$current_page_num-1}">{/if} {if $current_page_num==$total_pages_num}{else} {if $total_pages_num>$current_page_num}<link rel="next" href="{url page=$current_page_num+1}">{/if}{/if} Как вы решили с последним урлом в пагинации, у меня все равно добавляет +1. Quote Link to post Share on other sites
Volnorez Posted March 16, 2018 Report Share Posted March 16, 2018 И вопрос в догонку, как отдавать noindex если применили сортировку? {if $filter['sort'] = 'price'} <meta name="robots" content="noindex, follow"/> {/if} это пальцем в небо, как описать это в if? Quote Link to post Share on other sites
Noxter Posted March 16, 2018 Report Share Posted March 16, 2018 И вопрос в догонку, как отдавать noindex если применили сортировку? {if $filter['sort'] = 'price'} <meta name="robots" content="noindex, follow"/> {/if} это пальцем в небо, как описать это в if?{if $smarty.get.sort}...{/if} Quote Link to post Share on other sites
Volnorez Posted March 16, 2018 Report Share Posted March 16, 2018 {if $smarty.get.sort}...{/if}Алилуя, надеюсь я объединил корректно? {if $current_page_num>1 || $smarty.get.sort} <meta name="robots" content="noindex, follow"/> {/if} Спасибо.Буду благодарен если еще с этим подскажете {if $current_page_num==$total_pages_num}{elseif $total_pages_num>1}<link rel="next" href="{url page=$current_page_num+1}">{/if} Quote Link to post Share on other sites
Noxter Posted March 16, 2018 Report Share Posted March 16, 2018 Алилуя, надеюсь я объединил корректно? {if $current_page_num>1 || $smarty.get.sort} <meta name="robots" content="noindex, follow"/> {/if} Спасибо.Буду благодарен если еще с этим подскажете {if $current_page_num==$total_pages_num}{elseif $total_pages_num>1}<link rel="next" href="{url page=$current_page_num+1}">{/if} Мне угадать что вы имеете в виду? Quote Link to post Share on other sites
Volnorez Posted March 16, 2018 Report Share Posted March 16, 2018 Мне угадать что вы имеете в виду?Пардон, хочу вывести пагинацию prev-next на категории, то код из pagination.tpl генерирует на последней станице номер страницы +1То есть если всех страниц 10 в категории, то <link rel="next" href="{url page=$current_page_num+1}"> сгенерирует ?page=11, а надо только <link rel="prev" href="{url page=$current_page_num-1}"><link rel="next" не выводить совсем.как написать условие, чтобы <link rel="next" href="{url page=$current_page_num+1}"> не выводился?я предположил, что если $current_page_num==$total_pages_num , то условие должно было бы выполнятся, но нет. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.