Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,110 of 9,110 pages
About the help in other languages
All help pages

Page metadata and social sharing

Give every page its own title, description, keywords and Open Graph image - with the xrowmetadata extension or fields of your own - and print them safely in the pagelayout.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/website-creators/metadata-and-social-sharing.md

On this page

Page metadata and social sharing

This page is for website creators who want each page to carry its own title, description and sharing image. Out of the box a design prints site-wide values (SiteName, SiteDescription; see Branding). Per page values come from the xrowmetadata extension or from fields you add to classes.

Contents

  1. Two ways
  2. With xrowmetadata
  3. With your own fields
  4. Open Graph and sharing images
  5. Checklist

Two ways

xrowmetadataYour own fields
Editors fillone metadata field per object: title, keywords, description, Open Graph imageordinary fields (meta_description, share_image)
Defaultsa default Open Graph image per classyour template decides
Sitemapsfour sitemap cronjobs includedseparate extension
Choose whenyou want a complete packageyou want only one or two fields

With xrowmetadata

From xrowmetadata:

  1. Add the meta data datatype to the classes to describe (Setup > Classes).

  2. Print it in the pagelayout:

    {def $meta = metadata( $module_result.node_id )}
    {if $meta}
        {if $meta.title}<title>{$meta.title|wash}</title>{/if}
        {if $meta.description}<meta name="description" content="{$meta.description|wash}">{/if}
    {else}
        <title>{$site.title|wash}</title>
    {/if}
    {undef $meta}
  3. Run the sitemap cronjob and register the sitemap (XML sitemaps).

With your own fields

Add a meta_description field (eztext) and use the intro when it is empty:

{if is_set( $module_result.node_id )}
  {def $page = fetch( 'content', 'node', hash( 'node_id', $module_result.node_id ) )
       $desc = ''}
  {if and( is_set( $page.data_map.meta_description ), $page.data_map.meta_description.has_content )}
    {set $desc = $page.data_map.meta_description.content}
  {elseif and( is_set( $page.data_map.intro ), $page.data_map.intro.has_content )}
    {set $desc = $page.data_map.intro.content.output.output_text|striptags|shorten( 160 )}
  {/if}
  {if $desc}<meta name="description" content="{$desc|wash}">{/if}
  {undef $page $desc}
{/if}

Place it inside the pagelayout's cache block, which is keyed by the address, or the fetch runs on every request.

Open Graph and sharing images

Social networks read og:title, og:description, og:image and og:url. The simple theme already prints og:title, og:site_name and an og:image from the design (Branding). For a per-page image, use xrowmetadata's og_image (with a class default) or an image relation of your own, and print an alias of a suitable size with the full address (|ezroot( , 'full' ) or the host name):

<meta property="og:image" content="{$image.url|ezroot( no, 'full' )}">

Checklist

  • To do: Every page type has a title and description, with a sensible fallback.
  • To do: Values are printed with |wash.
  • To do: Sharing images are absolute URLs of an alias large enough for previews.
  • To do: The metadata is inside a cache block keyed by the page.
  • To do: Editors know which field becomes the description.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x