Skip to content

Commit

Permalink
Merge pull request #60 from plone/3931.feature
Browse files Browse the repository at this point in the history
Allow including js in head section
  • Loading branch information
mauritsvanrees authored Apr 23, 2024
2 parents caf7564 + ad6e778 commit a618799
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions news/3931.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Add a field ``webstats_head_js`` to the Site controlpanel and render its
contents in the head section using ``IHtmlHeadLinks`` viewlet manager.
See `issue 3931 <https://github.com/plone/Products.CMFPlone/issues/3931>`_:
some javascript needs to be loaded at the bottom of the page, and some in the head section.
[jladage]

17 changes: 15 additions & 2 deletions src/plone/base/interfaces/controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,10 +1198,23 @@ class ISiteSchema(Interface):
required=False,
)

webstats_head_js = schema.SourceText(
title=_("JavaScript integrations included in head section"),
description=_(
"For enabling third-party JavaScript integrations "
"from external providers (e.g., Google "
"Analytics), paste the provided code snippet here. "
"It will be rendered as "
"entered at the end of the head section of the page."
),
default="",
required=False,
)

webstats_js = schema.SourceText(
title=_("JavaScript for web statistics support"),
title=_("JavaScript integrations included after the footer"),
description=_(
"For enabling web statistics support "
"For enabling third-party JavaScript integrations "
"from external providers (e.g. Google "
"Analytics). Paste the provided code snippet here. "
"It will be rendered as "
Expand Down

0 comments on commit a618799

Please sign in to comment.