You are here

seoHrefLangAvailableVersions

Used by the following Containers: 
Variable Type: 
Custom Javascript
Provides a string of all language and Language-Geolocalised versions of this page
	function() {
  	var seoHrefLangIsDefined = {{seoHrefLangIsDefined}};

	if (seoHrefLangIsDefined) {
      	// the seed data
      	var seoHrefLang = {{seoHrefLang}};
      	var seoHrefLangLength = {{seoHrefLangLength}};
		// default result
      	var seoHrefLangAvailableVersions = [];
      	var i;
		for ( i = 0; i < seoHrefLangLength ; i++ ) {
          	if ( seoHrefLang[i].hreflang != 'x-default' ) {
              	seoHrefLangAvailableVersions.push(seoHrefLang[i].hreflang)
          	}
      	}
      	return seoHrefLangAvailableVersions.toString();
	} else {
		return undefined;
	}
}