23

How to activate feature via Managed Client Object Model: public void ActivateFeature(string webFullUrl,Guid featureId,bool force,FeatureDefinitionScope featdefScope) { using (var ctx = new ClientContext(webFullUrl)) { var features = ctx.Web.Features; ctx.Load(features); ctx.ExecuteQuery(); features.Add(featureId, force, ...


22

I know exactly what you're looking for. While a debate about proper link tag usage and CSS storage folders is always a fun topic, realize none of that is your issue here. There are two components that allows you to add <link> tags to Page Layouts. First, you need to find the following lines of code in the head of the Page Layout's HTML page: <!--...


10

You can use this method: function ActivateFeature(featureGuid) { var clientContext = new SP.ClientContext.get_current(); var site = clientContext.get_site(); var guid = new SP.Guid('{'+featureGuid+'}'); var featDef = site.get_features().add(guid, false, SP.FeatureDefinitionScope.site); clientContext.executeQueryAsync(Function.createDelegate(this, this....


9

In addition to Milind's answer: it is not good practice to put html directly into the CEWP just because you can. For one, it will only work on some kinds of pages. Web part pages are fine, wiki pages will chew the html. Secondly, it will be hard to maintain, since you will need to edit the web part itself every time you want to make a change. As an ...


8

Every SharePoint site is (on general) the same, where the only difference is what features are activated. A Publishing site have the site scoped Publishing infrastructure feature activated, and the web scoped SharePoint publishing feature activated. By this a library or list can make use of Major and minor versions (with history) Content approval Check out/...


7

try to use this query: SPQuery q = new SPQuery(); q.ViewAttributes = "Scope=\"Recursive\"" q.Query = "<Where><Geq><FieldRef Name='CheckoutUser' LookupId='TRUE'/><Value Type='int'>0</Value></Geq></Where>"; var pages = pagesList.GetItems(q);


7

$siteUrl = "http://ukreddy:3456/" $siteCollection = Get-SPSite $siteUrl Enable-SPFeature "PublishingSite" -Url $siteCollection.Url -force Enable-SPFeature "PublishingWeb" -Url $siteCollection.Url -force http://ukreddysharepoint2010.blogspot.co.uk/2014/05/error-systemargumentexception-value.html Sharepoint was failing to activate the feature PublishingWeb. ...


7

Publishing functionality is a set of two features, one at the Site Collection level and one at the Site level. You can activate them on any site like Team site, Document Center, Wiki site etc… You will find all the info on what publishing adds in that link, but here I want to showcase some reasons why I use Publishing for my clients. The publishing site ...


7

Every major version will in UIVersion be based on version * 512, so you will have to compare on 1536. For completeness Minor versions will increment the version with 1, and every major with 512. So 0.1 is 1 1.0 is 512 1.1 is 513 2.0 is 1024 2.1 is 1025 and so on


6

The type of pages available by default (wiki vs. article and web part pages) is the primary difference. Since wiki pages in 2010 allow for web parts to be inserted, many people are now choosing enterprise wiki sites over publishing sites. The only big thing you lose with wiki sites over publishing sites are page layout templates. Wikis have some basic ...


6

Yes there are four List Event Receivers: ListAdding(SPListEventProperties) ListAdded(SPListEventProperties) ListDeleting(SPListEventProperties) ListDeleted(SPListEventProperties) You may be interested in first two. See here for more info: http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.splisteventreceiver.listadding(v=office.14).aspx ...


6

There are a few things that control this in site settings --> navigation. Managed Navigation -- use a term set for navigation Add new pages to navigation automatically -- a new item is added to the termset for each new page Create friendly URLs for new pages automatically -- This is what you're concerned about - the page shows up in the URL without the ....


6

This issue most frequently occurs because the Community Sites or the SharePoint Server Publishing feature is currently enabled or was previously enabled for the affected site. SharePoint doesn’t support creating a template from a site where publishing or community features were enabled. This is because the publishing feature creates site elements that are ...


5

As each my "mysite" is a new site collection using a Microsoft Site Definition, there is no no-code solution for automatically adding web parts to a page. (Well there is one no-code solution: Someone could sit in central administration add refresh the list of "mysites" and when he sees a new one he could log in and add the web parts, but I think that after a ...


5

rjcup, Your client is likely not the right entity to ask what solution is best. If you're the developer, then you should know best and if your client doesn't trust your judgement, then your client has a problem much greater than how to get something done. If that client knows more about SharePoint than you do, then you have a quite different problem as well....


5

To add what John said, Publishing sites are better when you are doing a .COM public facing site, when you need more publishing controls, more control over who can author, edit & publish, and when you want to enforce a specific look & feel & brand.


5

I prefer not to create sub-sites for navigational structure alone - mainly because it is hard to change the structure again. But you actually have some good alternatives when you are willing to create a custom navigation data source. Below are two options that will also not require you to create folders in your Pages library. They also make it harder to ...


5

Take a look to this link that explain How propagation works: http://blogs.technet.com/b/sharepoint_quick_reads/archive/2013/08/12/sharepoint-2013-variations-content-synchronization-between-source-and-target-variations.aspx Also check the timer jobs that are responsible of the propagations and the Variations log. From the link: Custom lists and ...


4

SharePoint pages already include a #mainContent anchor that you could reuse: <a href="#mainContent">Back to Top</a> I think it is also associated with the accesskey J.


4

You could use PowerShell for this. The most tricky part is checking in/out and approving depending on what type of publishing is enabled, and weather pages are already checked out by others. Check out the stub code below. Included two methods to ensure that checkout and approve is done correctly depending on setup. A couple of things to note: BE AWARE ...


4

You have to use SiteDataQuery as replied by Thomson above. Here is some sample code SPWeb web = SPContext.Current.Site.RootWeb; SPSiteDataQuery query = new SPSiteDataQuery(); //Server template for page library is 850 query.Lists = "<Lists ServerTemplate='850' Hidden='TRUE' />"; query.ViewFields = @"<FieldRef Name='URL' Nullable='True' Type='...


4

Normally, pages created in site/SitePages wont have the Publishing tab because versioning on these Library types are set to "Create major versions" . Major versions do not require Publishing as it creates a new major version when you check-in, save. Pages created in site/Pages will have the publishing because that Library type is set to create "major and ...


4

Another, non code way to get a list of all checked out items, is the following. This is a neat small tool for your content editors, too. go to http://website/Reports%20List/AllItems.aspx Add new item. At the same query as above (0) go to the sitemanager http:///_layouts/sitemanager.aspx Select your library with publishing pages in it. Select in "View" the ...


4

All good answers, I'll just add that both WebPart and UserControl are derivatives of System.Web.UI.Control, and as such are just two different tools in the same box. Normal practice is to build the UserControl, then add a WebPart that simply loads it. This gives you both options for use. In your case you are probably going to use UserControl since ...


4

I am loading an infopath form inside the InfoPath Form Web Part after clicking a link from another page. I wanted to use the Source URL parameter but found it wasn't working. Here is my solution: <script type="text/javascript"> function RedirectIfFormIsClosed(){ var elem = document.getElementById('DialogFinalMessage'); if (elem !== null &&...


4

You can just create an accouncements list on any site using "Site Action" | "More Options" and choose "Announcements" Once the announcements list is created you can insert the list web part for it on any page. If the site doesn't have the announcements list you can either active the visible Team Collaboration Lists feature or the hidden announcementslist ...


4

Well Pedro, while you are right that the master pages are used for different types of pages, you're a little off on which types of pages use which type of master page. Publishing pages in your publishing site will use the site master page that you specify. These are the pages that are stored in the Pages library of your site by default. Publishing pages use ...


4

Create a new page layout based on the Enterprise wiki but including your web part. This page layout can then be used by all your Enterprise wiki sub-sites. The simplest way is probably to copy the existing Enterprise wiki page layout in the first instance. You will need to use something like SharePoint Designer to achieve this.


Only top voted, non community-wiki answers of a minimum length are eligible