Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: Access Page Owner contact email?

OK, this is interesting. This returns the Page Contact, using the CAMLQueryOptions to expand the user field (thanks fereko). I'm assuming the contact with ID 1 is always the page owner (seems to be in the tests I've run), but can someone confirm?

 

$().SPServices({
	operation: "GetListItems",
	async: false,
	listName: "Pages",
	CAMLViewFields: "<ViewFields><FieldRef Name='PublishingContactEmail' /><FieldRef Name='PublishingContact' /></ViewFields>",
	CAMLQueryOptions: "<QueryOptions><ExpandUserField>True</ExpandUserField></QueryOptions>",
	completefunc: function (xData, Status) {
		$(xData.responseXML).SPFilterNode("z:row").each(function() {
			if ($(this).attr("ows_PublishingContactEmail")) {
				var contactEmail = $(this).attr("ows_PublishingContactEmail");
				console.log("ows_PublishingContactEmail:",contactEmail);
			} elseif ($(this).attr("ows_PublishingContact")) {
				var contact = $(this).attr("ows_PublishingContact");
				console.log("contact: ",contact);
			}
		});
	}
});

 


Viewing all articles
Browse latest Browse all 6517

Trending Articles



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