Wednesday, July 23, 2014

Get all Site and Subsites collection from other Web Application within the server

<div id="divContainer"></div>
<script src="/jquery.js/" type="text/javascript"></script><script src="//SPAPI_Core.js" type="text/javascript"></script><script src="/SPAPI_Webs.js" type="text/javascript"></script>

<script type="text/javascript">
s = new SPAPI_Webs(siteURL);
var xmlhttp= webs.getAllSubWebCollection();
if(xmlhttp.status == 200){
var xmlDoc = xmlhttp.responseXML;
var Webid= xmlDoc.getElementsByTagName("Web");
var html= '<table>';
for (i=0;i<Webid.length;i++) {
   var linkTitle = Webid[i].attributes.getNamedItem("Title").nodeValue;
   var linkURL = Webid[i].attributes.getNamedItem("Url").nodeValue;
   html = html + '<tr><td>';
   html = html + '<p style="border-radius:10px;background-color:Silver;border:2px solid black"><a href="' + linkURL + '">' + linkTitle + ' <img src="PlayButton.jpg" style="height:15px;width:15px;float:right" alt="linkButton"/></a></p>';
   html = html + '</td></tr>';
   }
}
html=html + "</table>";
document.getElementById("divContainer").innerHTML=html;

</script>

Get DDM values from SharePoint List in CEWP

Get DDM values from SharePoint List in CEWP

<div id="divContainer" ></div>

<script src="jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="SPAPI_Core.js" type="text/javascript"></script>
<script src="SPAPI_Lists.js" type="text/javascript"></script>
<script type="text/javascript">

function getDDMValues() {
var pcSites = new SPAPI_Lists(siteUrl );
var pcList = pcSites.getList(listName);
html = '<table width="100%">';
$(pcList.responseXML).find("Field[DisplayName='Community Type'] CHOICE").each(function () {
var fieldValue = $(this).text();
html = html + '<tr>';
html = html + '<td  onclick="getByType(this.innerText);">' + fieldValue + ' <img  src="/sites/myparagon/MIX/ImageLibrary/PlayGreen.jpg"
style="height:20px;width:20px;border:none;float:right;" alt=""/></td>';
html = html + '</tr>';
html = html + '<tr><td></td></tr>';
});
html = html + '</table>';
document.getElementById("divContainer").innerHTML = html;
}
</script>

How TO GET THE CURRENT SITE in CEWP using SPServices

How TO GET THE CURRENT SITE in CEWP
<script src="//JSFiles/jquery-1.11.1.min.js"></script>
<script src="//JSFiles/jquery.SPServices-2014.01.min.js"></script>

<script type="text/javascript">      

            var thisSite = $().SPServices.SPGetCurrentSite();
          alert(thisSite);
            document.write("The Current Site is " + thisSite);

</script>

Hide DIV when click outside of the specific div with jQuery

Hide DIV when click outside of the specific div with jQuery


<html>
<head>
    <title>GETTYPES</title>
</head>
<script src="\JSFiles\jquery-1.11.1.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    var imageClicked = 0;
     document.onclick = function () {
        var menuList = document.getElementById("divMenuListContainer");
        if (imageClicked == 1) {
            //do nothing
            imageClicked = 0;
        }
        // Click was outside the box, hide it.
        else {
            //hide specific div
            html = '<p></p>';
            document.getElementById("divMenuListContainer").innerHTML = html;
        }
    }

    function getCommunitiesByType(type) {
         imageClicked = 1;
        var html = '<table width="100%">';
         html = html + '</table>';
         document.getElementById("divMenuListContainer").innerHTML = html;
        
    }

    function getCommunitiesChoices() {
        var html="<table onclick='getCommunitiesByType(this.innerText)'>";
           html = html + "</table>";
        document.getElementById("divContainer").innerHTML = html;
    }
</script>
<body>
<button onclick="getCommunitiesChoices();" type="button" value="button">Click ME to Get PC types</button>
<table id="tableID">
<tbody><tr>
<td valign="top"><div id="divContainer" style="border-top: cadetblue 1px solid; border-right: 1px solid; border-bottom: 1px solid; border-left: 1px solid"></div></td>
<td valign="top"><div id="divMenuListContainer"></div></td>
</tr></tbody></table>
</body>
</html>

Wednesday, May 21, 2014

SharePoint 2010 Base Types, List Template and Definition IDs, and Content Types IDs

Base Types

These Base Types come from the SPBaseType enumeration.
Base TypeID
 Custom List0
 Document Library1
Not used2
 Obsolete. Use 0 for discussion boards.3
 Surveys4
 Issues List5
 List Definitions
These List Definitions come from the SPListTemplateType enumeration.
Enumeration NameDescriptionID
InvalidTypeNot used-1
NoListTemplateunspecified list type0
GenericListCustom list100
DocumentLibraryDocument library101
SurveySurvey102
LinksLinks103
AnnouncementsAnnouncements104
ContactsContacts105
EventsCalendar106
TasksTasks107
DiscussionBoardDiscussion board108
PictureLibraryPicture library109
DataSourcesData sources for a site110
WebTemplateCatalogSite template gallery111
UserInformationUser Information112
WebPartCatalogWeb Part gallery113
ListTemplateCatalogList Template gallery114
XMLFormXML Form library115
MasterPageCatalogMaster Page gallery116
NoCodeWorkflowsNo Code Workflows117
WorkflowProcessCustom Workflow Process118
WebPageLibraryWiki Page Library119
CustomGridCustom grid for a list120
SolutionCatalogSolutions121
NoCodePublicNo Code Public Workflow122
ThemeCatalogThemes123
DataConnectionLibraryData connection library for sharing information about external data connections130
WorkflowHistoryWorkflow History140
GanttTasksProject Tasks150
MeetingsMeeting Series (Meeting)200
AgendaAgenda (Meeting)201
MeetingUserAttendees (Meeting)202
DecisionDecisions (Meeting)204
MeetingObjectiveObjectives (Meeting)207
TextBoxText Box (Meeting)210
ThingsToBringThings To Bring (Meeting)211
HomePageLibraryWorkspace Pages (Meeting)212
PostsPosts (Blog)301
CommentsComments (Blog)302
CategoriesCategories (Blog)303
FacilityFacility402
WhereaboutsWhereabouts403
CallTrackCall Track404
CirculationCirculation405
TimecardTimecard420
HolidaysHolidays421
IMEDicIME (Input Method Editor) Dictionary499
ExternalListExternal600
IssueTrackingIssue tracking1100
AdminTasksAdministrator Tasks1200
HealthRulesHealth Rules1220
HealthReportsHealth Reports1221

Content Types

These content types come from the Content Type ID list.
Content TypeID
System0x
Item0×01
Document0×0101
Event0×0102
Issue0×0103
Announcement0×0104
Link0×0105
Contact0×0106
Message0×0107
Task0×0108
Workflow History0×0109
Post0×0110
Comment0×0111
East Asia Contact0×0116
Folder0×0120
Referred :- 

http://joelblogs.co.uk/2011/06/16/sharepoint-2010-base-types-list-template-and-definition-ids-and-content-types-ids

and MSDN site
 

🚀Microsoft Copilot – Free vs. Licensed vs. Copilot Studio (Complete Guide)

Artificial Intelligence is rapidly transforming workplace productivity. Microsoft’s Copilot ecosystem is at the heart of this shift, but the...