mirror of
https://github.com/e107inc/e107.git
synced 2025-08-28 16:50:07 +02:00
Issue #4352 e107::canonical() method added.
Use define('e_DEBUG_CANONICAL', true); in e107_config.php to test usage.
This commit is contained in:
@@ -13,11 +13,6 @@
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if(deftrue('USER_AREA') && (defset('e_PAGE') === 'gsitemap.php'))
|
||||
{
|
||||
$canonicalurl = e107::url('gsitemap', 'index', null, array('mode' => 'full'));
|
||||
e107::link(array('rel'=>"canonical", "href" =>$canonicalurl));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -348,6 +348,11 @@ class news_front
|
||||
$newsRoute = 'list/'.$this->action;
|
||||
break;
|
||||
|
||||
case 'item':
|
||||
case 'extend':
|
||||
$newsRoute = 'view/item';
|
||||
break;
|
||||
|
||||
default:
|
||||
$newsRoute = 'list/items';
|
||||
break;
|
||||
@@ -531,7 +536,10 @@ class news_front
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $news news and category table row. ie. news_id, news_title, news_sef ... category_id etc.
|
||||
* @param string $type
|
||||
*/
|
||||
private function setNewsFrontMeta($news, $type='news')
|
||||
{
|
||||
|
||||
@@ -545,6 +553,7 @@ class news_front
|
||||
|
||||
case "all":
|
||||
e107::meta('robots', 'noindex');
|
||||
|
||||
break;
|
||||
|
||||
case "tag":
|
||||
@@ -590,12 +599,13 @@ class news_front
|
||||
break;
|
||||
|
||||
case "news":
|
||||
|
||||
e107::canonical($this->route, $news);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
e107::meta('robots', 'noindex');
|
||||
// e107::canonical('news');
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user