Bugzilla – Attachment 148593 Details for
Bug 33317
Add system preference to set meta robots for the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33317: Add system preference to set meta robots for the OPAC
Bug-33317-Add-system-preference-to-set-meta-robots.patch (text/plain), 4.13 KB, created by
ByWater Sandboxes
on 2023-03-23 09:21:21 UTC
(
hide
)
Description:
Bug 33317: Add system preference to set meta robots for the OPAC
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2023-03-23 09:21:21 UTC
Size:
4.13 KB
patch
obsolete
>From 96dadcfdf7b36bbae227e103ea09a86dd9caed5e Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 22 Mar 2023 22:16:09 +0000 >Subject: [PATCH] Bug 33317: Add system preference to set meta robots for the > OPAC > >Websites must have a robots meta tag to improve search engine crawling, so we could tell search engines to not index OPAC pages for example. >To test: >1) Look at opac-main source and see that meta name=robots is missing. >2) Apply patch. >3) Go to system preferences > OPAC and add some directives to OpacMetaRobots (ex: noindex,nofollow). >4) Look at opac-main source and confirm that meta name=robots now has content equal to the text set in the OpacMetaRobots system preference. >5) This should Prevent search engines from indexing Opac pages (if OpacMetaRobots is set to noindex) > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >--- > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 4 ++++ > koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc | 3 +++ > 3 files changed, 8 insertions(+) > >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 98eced6bc0..31576b3a4c 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -477,6 +477,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'), > ('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'), > ('OpacMetaDescription','','','This description will show in search engine results (160 characters).','Textarea'), >+('OpacMetaRobots','','','Improve search engine crawling.','Textarea'), > ('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my checkout history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'), > ('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'), > ('OpacNoItemTypeImages','0',NULL,'If ON, disables itemtype images in the OPAC','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index a1878233f6..9868bbfc3f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -66,6 +66,10 @@ OPAC: > - "This description will show in search engine results (160 characters)." > - pref: OpacMetaDescription > type: textarea >+ - >+ - "Improve search engine crawling." >+ - pref: OpacMetaRobots >+ type: textarea > - > - By default, show bibliographic records > - pref: BiblioDefaultView >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >index 05b5a393fd..441c34f6a8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >@@ -8,6 +8,9 @@ > [% IF ( Koha.Preference('OpacMetaDescription') ) %] > <meta name="description" content="[% Koha.Preference('OpacMetaDescription') | html %]" /> > [% END %] >+[% IF ( Koha.Preference('OpacMetaRobots') ) %] >+ <meta name="robots" content="[% Koha.Preference('OpacMetaRobots') | html %]" /> >+[% END %] > <link rel="shortcut icon" href="[% IF ( Koha.Preference('OpacFavicon') ) %][% Koha.Preference('OpacFavicon') | url %][% ELSE %][% interface | url %]/[% theme | url %]/images/favicon.ico[% END %]" type="image/x-icon" /> > <link rel="apple-touch-icon" href="[% IF ( Koha.Preference('OpacFavicon') ) %][% Koha.Preference('OpacFavicon') | url %][% ELSE %][% interface | url %]/[% theme | url %]/images/favicon.ico[% END %]" type="image/x-icon" /> > [% IF ( bidi ) %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33317
:
148575
|
148593
|
150420
|
158820
|
159653
|
160125
|
160126
|
160534
|
160539
|
160540
|
160541
|
160544
|
160545
|
160546
|
168071
|
168072
|
168073
|
168074
|
168075