[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] SEO: canonical URL homepage handling

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a28011256df0_39194c0435479@gitlab-sidekiq-low-urgency-cpu-bound-v2-d4ddd5fd7-9mmxl.mail>

Adrien Mbuya Maloba pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
0881660b by Olivier Kango at 2026-06-09T14:44:23+03:00
[FIX] SEO: canonical URL homepage handling
---
* [FIX] use Smarty assign for canonical URL variable

* [FIX] use base canonical URL for wiki homepage

See merge request tikiwiki/tiki!10202

- - - - -


1 changed file:

- templates/canonical.tpl


Changes:

=====================================
templates/canonical.tpl
=====================================
@@ -1,10 +1,11 @@
 {if $prefs.feature_canonical_url eq 'y' and isset($mid)}
-    {if $mid eq 'tiki-show_page.tpl' or $mid eq 'tiki-index_p.tpl' or $mid eq 'tiki-show_page_raw.tpl' or $mid eq 'tiki-all_languages.tpl' or $mid eq 'tiki-show_content.tpl'}
-        <link rel="canonical" href="{$base_url_canonical}{$page|sefurl}{if not empty($canonical_ending)}{$canonical_ending}{/if}">
-        <meta content="{$base_url_canonical}{$page|sefurl}{if not empty($canonical_ending)}{$canonical_ending}{/if}" property="og:url">
-    {elseif $mid eq 'extends:layouts/internal/layout_view.tpl|tiki-show_page.tpl'}
-        <link rel="canonical" href="{$base_url_canonical}{$page|sefurl}{if not empty($canonical_ending)}{$canonical_ending}{/if}">
-        <meta content="{$base_url_canonical}{$page|sefurl}{if not empty($canonical_ending)}{$canonical_ending}{/if}" property="og:url">
+    {if $mid eq 'tiki-show_page.tpl' or $mid eq 'tiki-index_p.tpl' or $mid eq 'tiki-show_page_raw.tpl' or $mid eq 'tiki-all_languages.tpl' or $mid eq 'tiki-show_content.tpl' or $mid eq 'extends:layouts/internal/layout_view.tpl|tiki-show_page.tpl'}
+        {assign var=canonical_url value=$base_url_canonical|cat:($page|sefurl)}
+        {if not empty($prefs.wikiHomePage) and $page eq $prefs.wikiHomePage}
+            {assign var=canonical_url value=$base_url_canonical}
+        {/if}
+        <link rel="canonical" href="{$canonical_url}{if not empty($canonical_ending)}{$canonical_ending}{/if}">
+        <meta content="{$canonical_url}{if not empty($canonical_ending)}{$canonical_ending}{/if}" property="og:url">
     {elseif $mid eq 'tiki-view_tracker_item.tpl'}
         <link rel="canonical" href="{$base_url_canonical}{$itemId|sefurl:trackeritem:null:null:'n'}">
         <meta content="{$base_url_canonical}{$itemId|sefurl:trackeritem:null:null:'n'}" property="og:url">



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0881660b1bc49bc83b46eed4109f9a7ff55f3478

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0881660b1bc49bc83b46eed4109f9a7ff55f3478
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.