-
Notifications
You must be signed in to change notification settings - Fork 8
05 Tag Helpers
Complete reference for all Meta Momentum Tag Helpers and their attributes.
Meta Momentum provides three main Tag Helpers:
-
<meta-momentum>- All-in-one meta tag renderer -
<meta-open-graph>- Open Graph tags only -
<meta-twitter-card>- Twitter Card tags only
The primary Tag Helper that outputs all meta tags for SEO and social media.
<meta-momentum meta-values="MetaValues" og-site-name="string" twitter-name="string" no-index="bool"> </meta-momentum>Type: MetaValues
Description: The Meta Momentum model from your content property.
Type: string
Description: Overrides the Open Graph site name configured in the Data Type.
Use Case: Multi-site Umbraco installations where each site has a different brand name.
Type: string
Description: Overrides the Twitter handle configured in the Data Type.
Format: Include the @ symbol (e.g., @username)
Type: bool
Description: Overrides the no-index setting from the content editor.
Use Cases:
- Force no-index on staging environments
- Programmatically control indexing based on page properties
- Temporarily prevent indexing during development
<meta-momentum
meta-values='@(Model.Value<MetaValues>("metaMomentum"))'
og-site-name='Custom Brand Name'
twitter-name="@@customhandle"
no-index='true'>
</meta-momentum>Note: You may need to double escape the twiter name like in the example above when not passing it as a variable.
Renders only Open Graph meta tags for Facebook, LinkedIn, and other platforms that support Open Graph protocol.
<meta-open-graph meta-values="MetaValues" title="string" description="string" share-image-url="string" og-site-name="string"> </meta-open-graph>Type: MetaValues
Description: When provided, all other attributes are ignored and values are taken from the model.
Example:
<meta-open-graph meta-values="@(Model.Value<MetaValues>("metaMomentum"))"></meta-open-graph>When you don't provide meta-values, you can manually specify each value:
Type: string
Description: The title to display in social shares.
Type: string
Description: The description to display in social shares.
Type: string
Description: Full URL to the share image (must be absolute URL).
Type: string
Description: The site/brand name.
<meta-open-graph title="Custom Page Title" description="Custom description for social sharing" share-image-url="https://example.com/images/share.jpg" og-site-name="My Company"> </meta-open-graph>Renders only Twitter Card meta tags for Twitter/X platform.
<meta-twitter-card meta-values="MetaValues" title="string" description="string" share-image-url="string" twitter-name="string"> </meta-twitter-card>Type: MetaValues
Description: When provided, all other attributes are ignored and values are taken from the model.
Example:
<meta-twitter-card meta-values="@(Model.Value<MetaValues>("metaMomentum"))"></meta-twitter-card>Type: string
Description: The title to display in Twitter cards.
Type: string
Description: The description to display in Twitter cards.
Type: string
Description: Full URL to the share image.
Type: string
Description: Twitter handle (include @).
<meta-twitter-card
title="Custom Tweet Title"
description="Custom description for Twitter sharing"
share-image-url="https://example.com/images/tweet.jpg"
twitter-name="@mycompany">
</meta-twitter-card>You can use different Tag Helpers for fine-grained control:
@{ var meta = Model.Value<MetaValues>("metaMomentum"); }
<!-- Standard SEO tags --> <title>@meta.Title</title> <meta name="description" content="@meta.Description" />
<!-- Open Graph with custom site name --> <meta-open-graph meta-values="@meta" og-site-name="Custom Brand"> </meta-open-graph>
<!-- Twitter with custom handle --> <meta-twitter-card meta-values="@meta" twitter-name="@custombrand"> </meta-twitter-card>