[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Fix wiki page title: no empty h1 when off, title inside main and...

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69ad61a28f56c_3b1fe90245822b@gitlab-sidekiq-low-urgency-cpu-bound-v2-6cd78889bf-gqm9k.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
5a2c6ad6 by Espoir Baraka at 2026-03-08T11:39:13+00:00
[FIX] Fix wiki page title: no empty h1 when off, title inside main and...
---
* [FIX] Fix wiki page title: no empty h1 when off, title inside main and div.content, breadcrumb link fallback

See merge request tikiwiki/tiki!9692

- - - - -


2 changed files:

- lib/breadcrumblib.php
- templates/tiki-show_page.tpl


Changes:

=====================================
lib/breadcrumblib.php
=====================================
@@ -335,6 +335,10 @@ function _breadcrumb_getTitle($crumbs, $loc)
             }
 
             $ret = '<a class="' . $class . '"' . $metadata . ' title="' . tra("refresh") . '" href="' . $escapedHref . '">';
+        } elseif ($loc == 'page' && $len > 0) {
+            /* current_object() can be unset on wiki view (e.g. section/request not set); without this, the h1 has no link (reported bug). */
+            require_once('tiki-sefurl.php');
+            $ret = '<a class="' . $class . '" title="' . tra("refresh") . '" href="' . filter_out_sefurl($crumbs[$len - 1]->url) . '">';
         } else {
             $ret = '';
         }
@@ -348,7 +352,7 @@ function _breadcrumb_getTitle($crumbs, $loc)
         }
         $ret .= tra("go back to this crumb");
         $ret .= '" accesskey="' . ($cnt);
-        include_once('tiki-sefurl.php');
+        require_once('tiki-sefurl.php');
         $ret .= '" href="' . filter_out_sefurl($crumbs[$len - 1]->url) . '">';
     }
     if ($prefs['feature_breadcrumbs'] == 'n' && $loc == "admin") {


=====================================
templates/tiki-show_page.tpl
=====================================
@@ -15,15 +15,7 @@ Note: The show content block must be defined at root level to use the include. A
         {if $prefs.feature_siteloc eq 'page' and $prefs.feature_breadcrumbs eq 'y'}
             {if $prefs.feature_siteloclabel eq 'y'}{tr}Location : {/tr}{/if}
             {breadcrumbs type="trail" loc="page" crumbs=$crumbs}
-            {if $prefs.feature_page_title eq 'y'}
-                {breadcrumbs type="pagetitle" loc="page" crumbs=$crumbs machine_translate=$machine_translate_to_lang source_lang=$pageLang target_lang=$machine_translate_to_lang}
-            {/if}
-        {/if}
-
-        {if $prefs.feature_page_title eq 'y'}
-            <h1 class="pagetitle">{breadcrumbs type="pagetitle" loc="page" crumbs=$crumbs machine_translate=$machine_translate_to_lang source_lang=$pageLang target_lang=$machine_translate_to_lang}</h1>
         {/if}
-
     {/if}
 {/block}
 
@@ -36,6 +28,8 @@ Note: The show content block must be defined at root level to use the include. A
 {/block}
 
 {block name=content}
+    {* hide_page_header = per-page "hide this page's title"; affects trail (title block) and h1 (here). *}
+    {assign var=show_wiki_page_title value=((!isset($hide_page_header) or !$hide_page_header) and ($prefs.feature_page_title eq 'y' or $prefs.wiki_page_name_inside eq 'y'))}
     {if !isset($hide_page_header) or !$hide_page_header}
         {include file='tiki-flaggedrev_approval_header.tpl'}
     {/if}
@@ -86,7 +80,7 @@ Note: The show content block must be defined at root level to use the include. A
         {/section}
     {/if}
 
-    <article id="top" class="wikitext highlightable clearfix{if $prefs.feature_page_title neq 'y'} nopagetitle{/if}">
+    <article id="top" class="wikitext highlightable clearfix{if $prefs.feature_page_title neq 'y' and $prefs.wiki_page_name_inside neq 'y'} nopagetitle{/if}">
         {if !isset($hide_page_header) or !$hide_page_header}
             {if $prefs.feature_freetags eq 'y' and $tiki_p_view_freetags eq 'y' and isset($tags[0]) and $prefs.freetags_show_middle eq 'y'}
                 {include file='freetag_list.tpl'}
@@ -130,10 +124,31 @@ Note: The show content block must be defined at root level to use the include. A
         {/if}
 
         <div id="page-data" class="clearfix">
-
-            {if $prefs.wiki_page_name_inside eq 'y'}
-                <h1 class="pagetitle">{breadcrumbs type="pagetitle" loc="page" crumbs=$crumbs machine_translate=$machine_translate_to_lang source_lang=$pageLang target_lang=$machine_translate_to_lang}</h1>
-            {/if}
+            {if $show_wiki_page_title}
+                {if $prefs.wiki_page_name_inside eq 'y'}
+                    <div class="content">
+                        <h1 class="pagetitle">{breadcrumbs type="pagetitle" loc="page" crumbs=$crumbs machine_translate=$machine_translate_to_lang source_lang=$pageLang target_lang=$machine_translate_to_lang}</h1>
+                        {if isset($pageLang) and Language::isLanguageRTL($pageLang)}
+                            <div style="direction:RTL; unicode-bidi:embed; text-align: right; {if $pageLang eq 'ar'}font-size: large;{/if}">
+                                {$parsed}
+                            </div>
+                        {else}
+                            {$parsed}
+                        {/if}
+                    </div>
+                {else}
+                    <h1 class="pagetitle">{breadcrumbs type="pagetitle" loc="page" crumbs=$crumbs machine_translate=$machine_translate_to_lang source_lang=$pageLang target_lang=$machine_translate_to_lang}</h1>
+                    <div class="content">
+                        {if isset($pageLang) and Language::isLanguageRTL($pageLang)}
+                            <div style="direction:RTL; unicode-bidi:embed; text-align: right; {if $pageLang eq 'ar'}font-size: large;{/if}">
+                                {$parsed}
+                            </div>
+                        {else}
+                            {$parsed}
+                        {/if}
+                    </div>
+                {/if}
+            {else}
             <div class="content">
                 {if isset($pageLang) and Language::isLanguageRTL($pageLang)}
                     <div style="direction:RTL; unicode-bidi:embed; text-align: right; {if $pageLang eq 'ar'}font-size: large;{/if}">
@@ -143,6 +158,7 @@ Note: The show content block must be defined at root level to use the include. A
                     {$parsed}
                 {/if}
             </div>
+            {/if}
             {if $prefs.wysiwyg_inline_editing eq 'y'}
                 <div class="d-none inline-editor-content">{$inline_editor_content}</div>
             {/if}



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5a2c6ad69f926714f32ab9c3df10fd626a3fe1bc

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5a2c6ad69f926714f32ab9c3df10fd626a3fe1bc
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.