Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Get the description of a site and display it in a CEWP

$
0
0

I am trying to display the title and description of a site in a CEWP.  So far I have managed to pull out the site's title using the following javascript:

<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("GetSiteName");

function GetSiteName(){
  var SiteName = document.getElementById('ctl00_PlaceHolderSiteName_onetidProjectPropertyTitle').innerHTML;//get the ID from 'view source' page
document.getElementById('lblsitename').innerHTML = SiteName;
}

</script><html><H1>Welcome to the <label id="lblsitename"></label></H1></html></div>


However, there is no id against the description where there is against the site title:

<a id="ctl00_PlaceHolderSiteName_onetidProjectPropertyTitle" href="/">Engagement Portal</a>

<div class="s4-pagedescription" tabindex="0" >Contact and Engagement site portal</div>

I have tried using getElementsByClassName, as well as getElementsByTagname.

Has anyone tried and succeeded with this?

Thanks


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>