It would be nice if there was a system preference to allow librarinans to insert HTML into the document <head>. Currently there is no way to add custom scripts or meta content, links to Google fonts, etc. Many already insert this in the OPACHeader but since that has moved to the News Tool it is less than ideal to do it this way. ( see bug 26942 )
Created attachment 119142 [details] [review] Bug 28080: Add OPACHTMLHead system preference To test: -Apply patch -Look for the syspref OPACHTMLHead -If you insert HTML it should be present inside the <head> on all pages in the OPAC -An easy way to test is to add something like this: <style>body{ background: red !important } </style> -All OPAC pages should then have a red background
Created attachment 119171 [details] [review] Bug 28080: Add OPACHTMLHead system preference To test: -Apply patch -Look for the syspref OPACHTMLHead -If you insert HTML it should be present inside the <head> on all pages in the OPAC -An easy way to test is to add something like this: <style>body{ background: red !important } </style> -All OPAC pages should then have a red background Signed-off-by: David Nind <david@davidnind.com>
Commenting in an attempt to remind myself to QA this as it would be very useful.
(In reply to Lucas Gass from comment #0) > It would be nice if there was a system preference to allow librarinans to > insert HTML into the document <head>. Currently there is no way to add > custom scripts or meta content, links to Google fonts, etc. > > Many already insert this in the OPACHeader but since that has moved to the > News Tool it is less than ideal to do it this way. ( see bug 26942 ) We now have this already: KohaPlugins.get_plugins_opac_head And: [% KohaPlugins.get_plugins_opac_js %] And: [% KohaPlugins.get_plugins_intranet_head %] So it is a discussion item whether we really should have this too. We miss an intranet counterpart here, that the plugins offer. And maybe the location of adding the pref content in doc-head-close is questionable? Should we add it at the end, if we would decide so? Could you raise this on koha-devel ?
> We now have this already: > KohaPlugins.get_plugins_opac_head > And: [% KohaPlugins.get_plugins_opac_js %] > And: [% KohaPlugins.get_plugins_intranet_head %] > > So it is a discussion item whether we really should have this too. > We miss an intranet counterpart here, that the plugins offer. > And maybe the location of adding the pref content in doc-head-close is > questionable? Should we add it at the end, if we would decide so? > > Could you raise this on koha-devel ? I think you are misunderstanding the purpose of this patch. Clearly, we should not have to build a plugin just to import a google font into Koha for some CSS style. That appears to be the purpose of this ehancement; to allow importing js and css into the correct part of Koha's html, the head block. Does that make sense?
(In reply to Kyle M Hall from comment #5) > > We now have this already: > > KohaPlugins.get_plugins_opac_head > > And: [% KohaPlugins.get_plugins_opac_js %] > > And: [% KohaPlugins.get_plugins_intranet_head %] > > > > So it is a discussion item whether we really should have this too. > > We miss an intranet counterpart here, that the plugins offer. > > And maybe the location of adding the pref content in doc-head-close is > > questionable? Should we add it at the end, if we would decide so? > > > > Could you raise this on koha-devel ? > > I think you are misunderstanding the purpose of this patch. Clearly, we > should not have to build a plugin just to import a google font into Koha for > some CSS style. That appears to be the purpose of this ehancement; to allow > importing js and css into the correct part of Koha's html, the head block. > > Does that make sense? Surely, this explanation is helpful :) In this case I would ask: Couldnt you do the same with OPACUserCSS and @import url() or @font-face and src: url()?
> Surely, this explanation is helpful :) > In this case I would ask: Couldnt you do the same with OPACUserCSS and > @import url() or @font-face and src: url()? Marcel, we can do that for CSS, yes. I thought maybe it would be beneficial to be able to add other things that belong in the HTML head, link/meta/style/script etc. But perhaps the use case is so small that is not worth adding a whole new system preference to Koha. I will go ahead and mark this one as invalid as there are workarounds to my problem.
(In reply to Lucas Gass from comment #7) > Marcel, we can do that for CSS, yes. I thought maybe it would be beneficial > to be able to add other things that belong in the HTML head, > link/meta/style/script etc. > > But perhaps the use case is so small that is not worth adding a whole new > system preference to Koha. I will go ahead and mark this one as invalid as > there are workarounds to my problem. Fair enough. But no one told you so yet. Stand with the first QA wave, cope with the second :)