# Themes - Page Types

Source: https://docs.arcxp.com/en/products/themes/themes---page-types.html

Arc XP Themes websites come with the common page types needed to run a publisher website. The Theme includes out-of-the-box templates for these page types, with all the Blocks you need for them. (For example, the Article template comes with an article body block; the Search template comes with a search filter block).

However sometimes, behind-the-scenes code that PageBuilder Editor users can’t configure directly (like advertising or analytics code) needs to behave differently depending on what type of page the user is on. For this reason, the page type is an explicit value (**page-type**) that you set on pages and templates in PageBuilder Editor. Arc XP Blocks use this value to set different behavior based on the page type – for example, setting a targeting parameter on ads, so that you can target based on page type. Additional uses are described in the [metadata sections](#UUID-fd3ca575-0ce8-641e-4a23-ea9ce6749039%5Fsection-idm234644116611649) on this page.

If you’re developing Custom Blocks, you can also utilize the **page-type** value to implement business logic that depends on what type of page is being rendered.

## List of Page Types

| Name                        | Description                                                                                                                                                                                      | page-type value  |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- |
| Article                     | A standalone article page that displays a single article                                                                                                                                         | _article_        |
| Video                       | A standalone video page that displays a single video                                                                                                                                             | _video_          |
| Gallery                     | A standalone gallery page that displays a single gallery                                                                                                                                         | _gallery_        |
| Section                     | A results page that displays a list of content in a given section                                                                                                                                | _section_        |
| Tag                         | A results page that displays a list of content with a given tag                                                                                                                                  | _tag_            |
| Author                      | A results page that displays a list of content by a given author                                                                                                                                 | _author_         |
| Homepage                    | The main landing page of your website**Note:** You will only have one homepage per website.                                                                                                      | _homepage_       |
| Queryly search              | A specialized search results page if you are using Queryly search. See[Themes - Queryly Search With Themes](https://docs.arcxp.com/en/products/themes/themes---queryly-search-with-themes.html). | _queryly-search_ |
| Nativo content landing page | A specialized page if you are using Nativo advertising.                                                                                                                                          | _nativo-clp_     |

## How to Set the Page Type

Your Themes website will come with the Page Type pre-populated for the templates and pages that are included out-of-the-box. For example, your tags template is set to have a **page-type** of _tags_, and your homepage is set to have a **page-type** of _homepage._

However, if you make new templates or standalone pages, you’ll need to ensure that the Page Type is set properly so that the behavior above functions as expected. Here’s how to do so:

![rId21.png](https://docs.arcxp.com/images/learning-center/image/img-a71637ee876f141908c97636e5c64a01.png) 
1. Go to the **Setup** space in your PageBuilder Editor page or template
2. Go to the **Page Metadata** section and add a new metadata with a key of **page-type** and a value from the list of valid Themes page types above
3. Publish your page

## How page-type is used for ads

While you can configure the Blocks that appear on a given template in PageBuilder Editor – like placing the Gallery Block on a gallery template – some behavior is set in the underlying code of the website, not something you can drag and drop onto a page. The main use cases for relying on the **page-type** are these situations where the behind-the-scenes code of the website needs to behave differently depending on what type of page is being rendered.

### Google Ads – Arc Block

**Targeting parameter**

Arc XP blocks for Google Ads set a targeting parameter on each ad called page-type, and sets it to the value of the page type. For example, all Google ads calls on section pages will include a targeting parameter of **page-type=section**. Your ad operations team can use this to target ads to a given page type, for example only to article pages or only to the homepage.

**Ad unit structure**

The ad unit hierarchy can change depending on what the page type is. For some page types, the end of the ad unit path changes dynamically based on the Site Service section path of the content’s primary section. (For example, the Politics section front is set to **/politics**, and an article in the news section is set to **/news**). Otherwise, the ad unit is simply _/\[DFP ID\]/\[optional website path\]/_

> **Note:**
> 
> The DFP ID and optional website path can be configured for each website. In the examples below, the DFP ID is **701** and the website path is **wpni**.

| Page Type               | Structure                                            | Example value        |
| ----------------------- | ---------------------------------------------------- | -------------------- |
| article, video, gallery | /\[DFP ID\]/\[optional website path\]/\[section ID\] | _/701/wpni/politics_ |
| section                 | /\[DFP ID\]/\[optional website path\]/\[section ID\] | _/701/wpni/politics_ |

## Metadata: All pages

The following metadata tags appear on _all_ pages, no matter what the **page-type** is set to, because these do not need to change per page type.

| Meta tag                    | Content                                | Example value                                                          |
| --------------------------- | -------------------------------------- | ---------------------------------------------------------------------- |
| meta name=viewport          | width=device-width, initial-scale=1    | (N/A – it will always be hardcoded to the value in the Content column) |
| meta property=og:site\_name | **\[Theme Settings: websiteName\]**    | _The Washington Post_                                                  |
| meta property=fb:admins     | **\[Theme settings: facebookAdmins\]** | _4403963_                                                              |
| meta name=twitter:site      | **\[Theme Settings: twitterAccount\]** | _@washingtonpost_                                                      |
| meta name=twitter:card      | summary\_large\_image                  | (N/A – it will always be hardcoded to the value in the Content column) |

## Metadata: article/video/gallery pages

The following metadata tags are added if **page-type** is set to **article** or **video** or **gallery**:

| Meta tag                                                   | Content                                                               | Example value                                                                                                                                               |
| ---------------------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _**Titles**_                                               |                                                                       |                                                                                                                                                             |
| <title>                                                    | **\[Basic headline\] – \[Theme Settings: websiteName\]**              | _How one medical checkup can snowball into a ‘cascade’ of tests, causing more harm than good – The Washington Post_                                         |
| meta property=og:title                                     | **\[Basic headline\]**                                                | _How one medical checkup can snowball into a ‘cascade’ of tests, causing more harm than good_                                                               |
| meta name=twitter:title                                    | **\[Basic headline\]**                                                | _How one medical checkup can snowball into a ‘cascade’ of tests, causing more harm than good_                                                               |
| _**Descriptions**_                                         |                                                                       |                                                                                                                                                             |
| meta name=description                                      | **\[Basic description\]**                                             | _For patients and doctors, the costs, time, stress, unnecessary biopsies and overdiagnosis can outweigh any benefits achieved from them._                   |
| _**Images**_                                               |                                                                       |                                                                                                                                                             |
| meta property=og:image_and_meta name=twitter:image         | **\[Promo Image\]**, or else\*\*\[Theme Settings: fallbackImage\]\*\* | <https://www.washingtonpost.com/resizer/v2/LRFFDGBMEAI6VP76AIGIRM7REA.jpg?auth=02bd78ef3e3fc682744cf6f4e76f711ffaa714b72c746cf08a7b0236fd06833f&width=1440> |
| meta property=og:image:alt_and_meta name=twitter:image:alt | Alt value of Promo Image                                              | _A stethoscope laying on a medical chart_                                                                                                                   |
| _**Other**_                                                |                                                                       |                                                                                                                                                             |
| og:type                                                    | if_page-type=article_, value is set to**article**                     | N/A (always set as described in the Content column)                                                                                                         |

## Metadata: section pages

The following metadata tags are added if **page-type** is set to **section**. See also documentation on how to configure the Section Metadata Title and Section Metadata Description fields in Site Service if desired. See [How to Set Up Site Service for Themes](https://docs.arcxp.com/en/products/themes/how-to-set-up-site-service-for-themes.html).

| Meta tag                                                   | Content                                                                                      | Example value                                                                                                                                                                                                                                      |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _**Titles**_                                               |                                                                                              |                                                                                                                                                                                                                                                    |
| <title>                                                    | **\[Section Metadata Title\]_or else:_\[Section name\]**–**\[Theme Settings: websiteName\]** | _The latest Sports news from The Washington Post\*\*Sports – The Washington Post_                                                                                                                                                                  |
| meta property=og:title                                     | **\[Section Metadata Title\]_or else:_\[Section name\]**–**\[Theme Settings: websiteName\]** | _The latest Sports news from The Washington Post\*\*Sports – The Washington Post_                                                                                                                                                                  |
| meta name=twitter:title                                    | **\[Section Metadata Title\]_or else:_\[Section name\]**–**\[Theme Settings: websiteName\]** | _The latest Sports news from The Washington Post\*\*Sports – The Washington Post_                                                                                                                                                                  |
| _**Descriptions**_                                         |                                                                                              |                                                                                                                                                                                                                                                    |
| meta name=description                                      | **\[Section Metadata Description\]**                                                         | _Politics from The Washington Post is the source for political news headlines, in-depth politics coverage and political opinion, plus breaking news on the Trump administration and White House, Congress, the Supreme Court, elections and more._ |
| _**Images**_                                               |                                                                                              |                                                                                                                                                                                                                                                    |
| meta property=og:image_and_meta name=twitter:image         | **\[Theme Settings: fallbackImage\]**                                                        | _<https://www.washingtonpost.com/pbox.php?url=https://www.washingtonpost.com/pb/resources/img/twp-social-share.png&amp;w=1484&amp;op=resize&amp;opt=1&amp;filter=antialias&amp;t=20170517>_                                                        |
| meta property=og:image:alt_and_meta name=twitter:image:alt | **\[Theme Settings: websiteName\] logo**                                                     | _The Washington Post logo_                                                                                                                                                                                                                         |

## Metadata: tag pages

The following metadata tags are added if **page-type** is set to **tag**:

| Meta tag                                                   | Content                                            | Example value                                                                                                                                                                               |
| ---------------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _**Titles**_                                               |                                                    |                                                                                                                                                                                             |
| <title>                                                    | **\[Tag name\] – \[Theme Settings: websiteName\]** | _Syria – The Washington Post_                                                                                                                                                               |
| meta property=og:title                                     | **\[Tag name\] – \[Theme Settings: websiteName\]** | _Syria – The Washington Post_                                                                                                                                                               |
| meta name=twitter:title                                    | **\[Tag name\] – \[Theme Settings: websiteName\]** | _Syria – The Washington Post_                                                                                                                                                               |
| _**Descriptions**_                                         |                                                    |                                                                                                                                                                                             |
| meta name=description                                      | **\[Tag description\]**                            | _The latest news about Syria from The Washington Post_                                                                                                                                      |
| _**Images**_                                               |                                                    |                                                                                                                                                                                             |
| meta property=og:image_and_meta name=twitter:image         | **\[Theme Settings: fallbackImage\]**              | _<https://www.washingtonpost.com/pbox.php?url=https://www.washingtonpost.com/pb/resources/img/twp-social-share.png&amp;w=1484&amp;op=resize&amp;opt=1&amp;filter=antialias&amp;t=20170517>_ |
| meta property=og:image:alt_and_meta name=twitter:image:alt | **\[Theme Settings: websiteName\] logo**           | _The Washington Post logo_                                                                                                                                                                  |

## Metadata: author pages

The following metadata tags are added if **page-type** is set to **author**:

| Meta tag                                                   | Content                                                         | Example value                                                                                                                                                                                                                                                                                     |
| ---------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _**Titles**_                                               |                                                                 |                                                                                                                                                                                                                                                                                                   |
| <title>                                                    | **\[Author byline\]**–**\[Theme Settings: websiteName\]**       | _Philip Rucker – The Washington Post_                                                                                                                                                                                                                                                             |
| meta property=og:title                                     | **\[Author byline\] – \[Theme Settings: websiteName\]**         | _Philip Rucker – The Washington Post_                                                                                                                                                                                                                                                             |
| meta name=twitter:title                                    | **\[Author byline\] – \[Theme Settings: websiteName\]**         | _Philip Rucker – The Washington Post_                                                                                                                                                                                                                                                             |
| _**Descriptions**_                                         |                                                                 |                                                                                                                                                                                                                                                                                                   |
| meta name=description                                      | **\[Short author bio\]**                                        | _Philip Rucker is the White House Bureau Chief for The Washington Post. He previously has covered Congress, the Obama White House, and the 2012 and 2016 presidential campaigns. Rucker also is a Political Analyst for NBC News and MSNBC. He joined The Post in 2005 as a local news reporter._ |
| _**Images**_                                               |                                                                 |                                                                                                                                                                                                                                                                                                   |
| meta property=og:image_and_meta name=twitter:image         | **\[Author image\]_or else:_\[Theme Settings: fallbackImage\]** | _<https://www.washingtonpost.com/pbox.php?url=https://s3.amazonaws.com/arc-authors/washpost/5c54a6a4-783c-468a-abd5-ee16a8284035.png&w=1484&op=resize&opt=1&filter=antialias&t=20170517>_                                                                                                         |
| meta property=og:image:alt_and_meta name=twitter:image:alt | **\[Author byline\]**                                           | _Philip Rucker_                                                                                                                                                                                                                                                                                   |

## Metadata: homepage

The following metadata tags are added if **page-type** is set to **homepage**:

| Meta tag                                                   | Content                                  | Example value                                                                                                                                                                               |
| ---------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _**Titles**_                                               |                                          |                                                                                                                                                                                             |
| <title>                                                    | **\[Theme Settings: websiteName\]**      | _The Washington Post_                                                                                                                                                                       |
| meta property=og:title                                     | **\[Theme Settings: websiteName\]**      | _The Washington Post_                                                                                                                                                                       |
| meta name=twitter:title                                    | **\[Theme Settings: websiteName\]**      | _The Washington Post_                                                                                                                                                                       |
| _**Images**_                                               |                                          |                                                                                                                                                                                             |
| meta property=og:image_and_meta name=twitter:image         | **\[Theme Settings: fallbackImage\]**    | _<https://www.washingtonpost.com/pbox.php?url=https://www.washingtonpost.com/pb/resources/img/twp-social-share.png&amp;w=1484&amp;op=resize&amp;opt=1&amp;filter=antialias&amp;t=20170517>_ |
| meta property=og:image:alt_and_meta name=twitter:image:alt | **\[Theme Settings: websiteName\] logo** | _The Washington Post logo_                                                                                                                                                                  |

## Metadata: No page-type value set

The following metadata tags are added if no value is set for **page-type** on the page or template:

| Meta tag                                                   | Content                                  | Example value                                                                                                                                                                               |
| ---------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _**Titles**_                                               |                                          |                                                                                                                                                                                             |
| <title>                                                    | **\[Theme Settings: websiteName\]**      | _The Washington Post_                                                                                                                                                                       |
| meta property=og:title                                     | **\[Theme Settings: websiteName\]**      | _The Washington Post_                                                                                                                                                                       |
| meta name=twitter:title                                    | **\[Theme Settings: websiteName\]**      | _The Washington Post_                                                                                                                                                                       |
| _**Images**_                                               |                                          |                                                                                                                                                                                             |
| meta property=og:image_and_meta name=twitter:image         | **\[Theme Settings: fallbackImage\]**    | _<https://www.washingtonpost.com/pbox.php?url=https://www.washingtonpost.com/pb/resources/img/twp-social-share.png&amp;w=1484&amp;op=resize&amp;opt=1&amp;filter=antialias&amp;t=20170517>_ |
| meta property=og:image:alt_and_meta name=twitter:image:alt | **\[Theme Settings: websiteName\] logo** | _The Washington Post logo_                                                                                                                                                                  |

See also:

- [Metadata Tags That Google Understands](https://support.google.com/webmasters/answer/79812)
- [Essential Meta Tags For Social Media](https://css-tricks.com/essential-meta-tags-social-media/)
- [Google’s Recommendations For Titles And Descriptions](https://support.google.com/webmasters/answer/35624)
- [Twitter Cards](https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started)

## link rel = “canonical”

To return the canonical through the `MetaData` component, you MUST include the `outputCanonicalLink` flag with `MetaData`:

```html
<MetaData outputCanonicalLink />
```

The `href` value of `<link rel=“canonical”>` is set differently depending on the page type.

Standalone content item pages (Article, Video, Gallery):

- WebsiteDomain of the **primary\_website** \+ **canonical\_url** in the content’s Arc XP Native Specification (ANS)
- This ensures that when multi-site organizations cross-publish content to multiple websites, the canonical URL points to the _originator_ of the content – for example, the **primary\_website** – and there aren’t multiple competing page versions in search results. In ANS, the story’s path on its primary website is stored in **canonical\_url** (and story paths on additional websites are stored as **website\_url** values for each website).
- Current implementation is done within the default-output-block as this might not apply to your site if you use the MetaData component.

_Tag pages:_

- WebsiteDomain _of the website being rendered + /tags/ + Story Tag_
- _Story Tag_ are defined in Composer under the Article Meta tab.

_Author pages:_

- WebsiteDomain _of the website being rendered + Bio Page URL_
- _Bio Page Url_ is defined in the Author Service detail pages

_Homepage:_

- WebsiteDomain _of the website being rendered_

_Section:_

- WebsiteDomain _of the website being rendered + Site Service Section ID_
- _Site Service Section ID_ is defined in the Site Service section details.

### Custom control over Canonicals

Due to the varying requirements and configurations available, we have exposed two ways to override the canonical URLs exposed on the page.

**canonicalDomain**

The first and easiest method is one that is utilized by the Article, Video, and Gallery pages above. The canonical domain can be overridden by passing _canonicalDomain_ to _<MetaData />_. Accepted values are valid domain strings.

```html
<MetaData canonicalDomain="https://myprimarydomain.com" outputCanonicalLink />
```

**canonicalResolver**

The second method is utilizing a callback function passed to the _canonicalResolver_ property. The following is an arbitrary example of replacing a portion of the URL, but the entire canonical URL can be returned here to override the default canonical resolution.

- If you return a _false_ value, the canonical will not be output, so it’s important to return the default resolution if you choose to utilize this callback.

```javascript
const canonicalResolver = (pageType, defaultResolution) => {
  if (pageType === 'search') {
    // replace `search` with `find` for now
    return defaultResolution.replace('/search/', '/find/');
  }
  return defaultResolution;
};

<MetaData canonicalResolver={canonicalResolver} outputCanonicalLink />
```

## Overriding or adding metadata values in PB Editor

You have the option to add a new metadata tag value or override some automatically generated metadata by entering the value directly in PageBuilder Editor’s metadata fields:

![rId30.png](https://docs.arcxp.com/images/learning-center/image/img-5edfc292240fe648459fcff93df974ed.png) ![rId33.png](https://docs.arcxp.com/images/learning-center/image/img-8c63a45ef87bd5aa4176ae562aaab8ba.png) 
- **title** This will override the value for the <title> tag
- **og:title** This will override the value for the og:title metadata tag
- **twitter:title** This will override the value for the twitter:title metadata tag
