Created
November 12, 2012 10:34
-
-
Save FernE97/4058566 to your computer and use it in GitHub Desktop.
SMARTY: link rel seo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{* if per page is set add canonical link *} | |
{if isset($_REQUEST.items_per_page)} | |
{assign var="page_current" value="/page-`$pagination.current_page`"} | |
{assign var="can_url" value=$config.current_url|fn_query_remove:"items_per_page"|fn_url} | |
{assign var="page_url" value=$can_url|replace:"$page_current":""} | |
<link href="{$config.current_location}{$page_url}" rel="canonical"> | |
{/if} | |
{* if paginated add rel prev/next links *} | |
{if $pagination.current_page >= 1} | |
{assign var="can_url" value=$config.current_url|fn_query_remove:"items_per_page"|fn_url} | |
{assign var="page_prev" value="page-`$pagination.prev_page`"} | |
{assign var="page_next" value="page-`$pagination.next_page`"} | |
{assign var="page_current" value="page-`$pagination.current_page`"} | |
{assign var="page_prev_url" value=$can_url|replace:"$page_current":"$page_prev"} | |
{assign var="page_next_url" value=$can_url|replace:"$page_current":"$page_next"} | |
{if $pagination.prev_page !== "0"} | |
<link href="{$config.current_location}{$page_prev_url}" rel="prev"> | |
{/if} | |
{if $pagination.next_page == "2"} | |
<link href="{$config.current_location}{$can_url}page-{$pagination.next_page}/" rel="next"> | |
{elseif $pagination.next_page > "2"} | |
<link href="{$config.current_location}{$page_next_url}" rel="next"> | |
{/if} | |
{/if} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I try add this code in my header.tpl file to print these link tags. After this my site return me this error:
Fatal error: Smarty error: [in header.tpl line 36]: [plugin] modifier 'fn_query_remove' is not implemented (core.load_plugins.php, line 118) in Smarty.class.php on line 1095
This error I receive and for fn_url. I use Smarty version 2.6.18. How I can remove this error?
Thank you in advance!