Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
What's new
2
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiki Wiki CMS Groupware
Tiki
Commits
e3072e03
Commit
e3072e03
authored
Jan 24, 2023
by
Josaphat Imani
Committed by
Adrien Mbuya Maloba
Jan 24, 2023
Browse files
[NEW] Multilingual lib: Added hreflang tag to pages
parent
9f27529e
Pipeline
#756169815
passed with stages
in 8 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/wiki/renderlib.php
View file @
e3072e03
...
...
@@ -209,6 +209,15 @@ class WikiRenderer
$this
->
smartyassign
(
'translationsCount'
,
count
(
$this
->
trads
));
$pageLang
=
$this
->
info
[
'lang'
];
$this
->
smartyassign
(
'pageLang'
,
$pageLang
);
$headerlib
=
TikiLib
::
lib
(
'header'
);
$links
=
[];
foreach
(
$this
->
trads
as
$trad
)
{
if
(
$trad
[
'lang'
]
!=
$this
->
info
[
'lang'
])
{
$links
[]
=
'<link rel="alternate" href="tiki-index.php?page='
.
$trad
[
'objName'
]
.
'" hreflang="'
.
$trad
[
'lang'
]
.
'">'
;
}
}
$headerlib
->
add_rawhtml
(
implode
(
"
\n
"
,
$links
)
.
"
\n
"
);
}
if
(
$prefs
[
'feature_machine_translation'
]
==
'y'
&&
$prefs
[
'lang_machine_translate_wiki'
]
==
'y'
&&
!
empty
(
$this
->
info
[
'lang'
]))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment