-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Upendo.OpenContentHelper project!
This DNN extension provides a lightweight, zero-installation solution to dynamically inject <meta> and <link> tags into the <head> of a page using data defined in an OpenContent module.
This project is ideal for:
- Site admins who want SEO, social media, or favicon metadata managed through content modules
- Themers and integrators who need tag injection without writing new modules or hacking templates
- Developers who want a safe, reusable method of injecting dynamic metadata
When combined with a properly configured OpenContent template:
- The OpenContent module allows administrators and content editors to define structured
<meta>and<link>tag data (such as for SEO, authorship, Open Graph, favicons, or canonical URLs). - The Upendo.OpenContentHelper theme object locates the relevant OpenContent module on the current page, extracts the stored tag data, validates it, and injects it into the page's
<head>section server-side. - This allows metadata to be managed like regular content β without modifying theme files, core settings, or relying on client-side hacks.
This approach keeps your site's metadata portable, maintainable, and content-managed β and is ideal for dynamic sites, marketing campaigns, or editor-driven optimization.
In your DNN theme layout (e.g., default.ascx):
<%@ Register TagPrefix="upendo" TagName="MetaInjector" Src="~/DesktopModules/Upendo.OpenContentHelper/View.ascx" %>
<upendo:MetaInjector runat="server" />This executes the logic that reads OpenContent data and injects tags.
- Add an OpenContent module to any page where you want metadata managed
- Set the module title to include the word
Meta(e.g.,OC: Meta Data Manager) - Begin adding tags using the editor.
DEMO VIDEO: How to Edit Page Meta Data in DNN
This helper uses the MetaValidationHelper.cs class to protect your site from invalid or malicious input. Highlights:
- Disallows
<,>, and script content in tag values - Rejects dangerous schemes like
javascript:ordata:inhref - Accepts only known-safe values for
relandnamefields - Limits field lengths (e.g., max 500 characters for
content) - Logs only one rejection per page request (prevents log flooding)
- Rejected inputs are logged using the DNN Event Log (as
HOST_ALERT) - You can preview data by switching the page with the OpenContent module to edit mode
- No metadata will be injected if the module is missing or schema is empty
-
MetaInjector.ascxβ skin object UI file -
MetaInjector.ascx.csβ main logic for locating module, loading data, injecting tags -
MetaValidationHelper.csβ reusable helper for sanitizing and validating tag data
We welcome feedback and contributions! To suggest changes, report issues, or submit a PR, visit the GitHub repository.
This project is provided under the MIT License.
Like what we're doing? Please sponsor us. Any amount is appreciated! ππ½
This project is owned and maintained by Upendo Ventures, LLC for the benefit of everyone in the DNN CMS Community & Ecosystem.