wix-router.WixRouterSitemapEntry

wix-router.WixRouterSitemapEntry

An object representing a single entry in a sitemap.

Contents

changeFrequency Sets or gets how frequently the page is likely to change.
lastModified Sets or gets when was the page data last modified.
pageName Sets or gets the page name.
priority Sets or gets the priority of this URL relative to other URLs on your site.
title Sets or gets the page title.
url Sets or gets the relative url of the page.
changeFrequency

changeFrequency

Sets or gets how frequently the page is likely to change.

Syntax

get changeFrequency(): string
set changeFrequency(value: string): void

Description

The value of the changeFrequency property provides general information to search engines and may not correlate exactly to how often they crawl the page.

Valid values

  • "always"
  • "hourly"
  • "daily"
  • "weekly"
  • "monthly"
  • "yearly"
  • "never"

Type

String

Examples

Get the change frequency of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgbGV0IGNoYW5nZUZyZXF1ZW5jeSA9IGVudHJ5LmNoYW5nZUZyZXF1ZW5jeTsgLy8gIndlZWtseSIKCn0K
export function myRouter_SiteMap(sitemapRequest) {

  let changeFrequency = entry.changeFrequency; // "weekly"

}

Set the change frequency of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgZW50cnkuY2hhbmdlRnJlcXVlbmN5ID0gIndlZWtseSI7Cgp9Cg==
export function myRouter_SiteMap(sitemapRequest) {

  entry.changeFrequency = "weekly";

}
lastModified

lastModified

Sets or gets when was the page data last modified.

Syntax

get lastModified(): Date
set lastModified(value: Date): void

Type

Date

Examples

Get the sitemap entry last modified date

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgbGV0IGxhc3RNb2RpZmllZCA9IGVudHJ5Lmxhc3RNb2RpZmllZDsKICBsZXQgeWVhciA9IGxhc3RNb2RpZmllZC5nZXRGdWxsWWVhcigpOyAvLyAyMDE3Cgp9Cg==
export function myRouter_SiteMap(sitemapRequest) {

  let lastModified = entry.lastModified;
  let year = lastModified.getFullYear(); // 2017

}

Set the sitemap entry last modified date

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgZW50cnkubGFzdE1vZGlmaWVkID0gbmV3IERhdGUoMjAxNywgOSwgMTMpOwoKfQo=
export function myRouter_SiteMap(sitemapRequest) {

  entry.lastModified = new Date(2017, 9, 13);

}
pageName

pageName

Sets or gets the page name.

Syntax

get pageName(): string
set pageName(value: string): void

Type

String

Examples

Get the name of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgbGV0IHBhZ2VOYW1lID0gZW50cnkucGFnZU5hbWU7IC8vICJQYWdlIE5hbWUiCgp9Cg==
export function myRouter_SiteMap(sitemapRequest) {

  let pageName = entry.pageName; // "Page Name"

}

Set the name of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgZW50cnkucGFnZU5hbWUgPSAiUGFnZSBOYW1lIjsKCn0K
export function myRouter_SiteMap(sitemapRequest) {

  entry.pageName = "Page Name";

}
priority

priority

Sets or gets the priority of this URL relative to other URLs on your site.

Syntax

get priority(): Number
set priority(value: Number): void

Description

The value of the priority property lets search engines know which pages you deem most important. Its value does not affect how your pages are compared to pages on other sites.

Valid values range from 0.0 to 1.0.

The default priority of a page is 0.5.

Type

Number

Examples

Get the relative priority of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgbGV0IHByaW9yaXR5ID0gZW50cnkucHJpb3JpdHk7IC8vIDAuOQoKfQo=
export function myRouter_SiteMap(sitemapRequest) {

  let priority = entry.priority; // 0.9

}

Set the relative priority of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgZW50cnkucHJpb3JpdHkgPSAwLjk7Cgp9Cg==
export function myRouter_SiteMap(sitemapRequest) {

  entry.priority = 0.9;

}
title

title

Sets or gets the page title.

Syntax

get title(): string
set title(value: string): void

Type

String

Examples

Get the title of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgbGV0IHRpdGxlID0gZW50cnkudGl0bGU7IC8vICJQYWdlIFRpdGxlIgoKfQo=
export function myRouter_SiteMap(sitemapRequest) {

  let title = entry.title; // "Page Title"

}

Set the title of the sitemap entry

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgZW50cnkudGl0bGUgPSAiUGFnZSBUaXRsZSI7Cgp9Cg==
export function myRouter_SiteMap(sitemapRequest) {

  entry.title = "Page Title";

}
url

url

Sets or gets the relative url of the page.

Syntax

get url(): string
set url(value: string): void

Type

String

Examples

Get the sitemap entry relative URL

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgbGV0IHVybCA9IGVudHJ5LnVybDsgLy8gIi9teVJvdXRlci9BIgoKfQo=
export function myRouter_SiteMap(sitemapRequest) {

  let url = entry.url; // "/myRouter/A"

}

Set the sitemap entry relative URL

ZXhwb3J0IGZ1bmN0aW9uIG15Um91dGVyX1NpdGVNYXAoc2l0ZW1hcFJlcXVlc3QpIHsKCiAgZW50cnkudXJsID0gIi9teVJvdXRlci9BIjsKCn0K
export function myRouter_SiteMap(sitemapRequest) {

  entry.url = "/myRouter/A";

}