Skip to content

05 Tag Helpers

David Sheiles edited this page Nov 27, 2025 · 2 revisions

Tag Helpers Reference

Complete reference for all Meta Momentum Tag Helpers and their attributes.

Overview

Meta Momentum provides three main Tag Helpers:

  1. <meta-momentum> - All-in-one meta tag renderer
  2. <meta-open-graph> - Open Graph tags only
  3. <meta-twitter-card> - Twitter Card tags only

<meta-momentum>

The primary Tag Helper that outputs all meta tags for SEO and social media.

Syntax

<meta-momentum meta-values="MetaValues" og-site-name="string" twitter-name="string" no-index="bool"> </meta-momentum>

Attributes

meta-values (required)

Type: MetaValues
Description: The Meta Momentum model from your content property.


og-site-name (optional)

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.


twitter-name (optional)

Type: string
Description: Overrides the Twitter handle configured in the Data Type.

Format: Include the @ symbol (e.g., @username)



no-index (optional)

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

Complete Example

<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.

<meta-open-graph>

Renders only Open Graph meta tags for Facebook, LinkedIn, and other platforms that support Open Graph protocol.

Syntax

<meta-open-graph meta-values="MetaValues" title="string" description="string" share-image-url="string" og-site-name="string"> </meta-open-graph>

Attributes

meta-values (semi-required)

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>

Manual Attributes (when meta-values is not provided)

When you don't provide meta-values, you can manually specify each value:

title

Type: string
Description: The title to display in social shares.


description

Type: string
Description: The description to display in social shares.


share-image-url

Type: string
Description: Full URL to the share image (must be absolute URL).


og-site-name

Type: string
Description: The site/brand name.


Manual Example

<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.

Syntax

<meta-twitter-card meta-values="MetaValues" title="string" description="string" share-image-url="string" twitter-name="string"> </meta-twitter-card>

Attributes

meta-values (required, unless providing values individually)

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>

Manual Attributes (when meta-values is not provided)

title

Type: string
Description: The title to display in Twitter cards.


description

Type: string
Description: The description to display in Twitter cards.


share-image-url

Type: string
Description: Full URL to the share image.


twitter-name

Type: string
Description: Twitter handle (include @).


Manual Example

<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>

Combining Tag Helpers

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>

Next Steps