Posts

Showing posts with the label sp 2013

SharePoint - Moving Sites and Subsites into another Site

If there is a need to move sites and subsites into another site within the same web application, this can be easily performed using the "Site Manager". Often times, this option is over-looked, in favor of site templates, or other backup and restore operations. However, this is the simplest option available. Note: This site is available on "SharePoint Online or Office 365 Dedicated" as well as any stand-alone SharePoint installation, on the basis that you activate the Publishing Features within SharePoint. If you visit "http://enter_your_site_url/_layouts/sitemanager.aspx", you'll see the Site Manager, where you can do a move operation of all pages and sub-sites. Select the parent site of the sub-site you want to move in the left navigation pane. Check the box next to the sub-site you want to move in the right pane. Click the Actions drop-down and click Move . Select Destination of the sub-site selected in the next dialog. SharePoint Sta...

SharePoint - Feature with ID already exists - Force Option

Occasionally, when deploying SharePoint Solutions (WSP) directly from Visual Studio, you will receive the following error. Error occurred in deployment step 'Add Solution': A feature with ID {Guid} has already been installed in this farm. Use the force attribute to explicitly re-install the feature. This error occurs when you have a previously defined feature installed, as part of the same solution, which will trigger the error. To overcome this issue, you can open the feature (double-click) which is part of your actual project, and you will see the properties window come into focus. In this window, you will see details, such as title, description, scope, items in the feature. In the property window, you'll see an option titled 'Always Force Install'. By default, this item is set to "false". If you set this option to "true", it will over-write the feature each time the project is installed. SharePoint Stack Exchange

SharePoint 2010 - The site is not valid. The 'Pages' document library is missing

Issue: If you're encountering the following error, via ULS, or the event log, due to a page library, This site is not valid. The 'Pages' document library is missing. The issue can be remedied with a quick powershell script. Workaround: Perform the following script on the page library causing the issue, and it will remove the error. $web = get-spweb http://somesite/somesubsite $pageId = $web.Lists["Pages"].ID $web.AllProperties["__PagesListId"] = $pageId.ToString() $web.Update()

SharePoint 2010 - Improving Chrome Support

Certainly, if you've utilized Google Chrome to browse SharePoint 2010 pages you've noticed the inflexible behavior caused by the on-demand javascript. You almost always have to refresh to ensure that the javascript functionality works - Modal Dialogs, Ribbon, etc. With some minor updates to the master page, you should be able to utilize Google Chrome without any problems. Firstly, you'll want to add some additional items in the <head> tag. Afterwards, at the bottom of your page just above the closing </body>, add the following javascript. // Attempt to detect if this is iframe content if (location.href == top.location.href) { if(navigator && navigator.userAgent && /chrome/.test(navigator.userAgent.toLowerCase()) && $){ $(document).ready(function(){ if(_spBodyOnLoadWrapper){_spBodyOnLoadWrapper();} if($("#s4-workspace") && $("#s4-ribbonrow")) { ...

SharePoint 2010 - MySite Redirection

When user's click a user's name in a document library, etc, a file userdisp.aspx controls where the user is directed. Assuming you want to have all user links bring users to My Sites, you can start off creating the user control, by the following code on http://blogs.sharepointguys.com/brendon/sharepoint-2007/programming/redirect-to-your-own-mysite-landing-page/ and then in the RedirectIfNecessary(SPListItem user) you can utilize the following code. if (Request.QueryString["id"] != null) { SPSite _site = SPContext.Current.Site; SPServiceContext _serviceContext = SPServiceContext.GetContext(_site); UserProfileManager _userProfileManager = new UserProfileManager(_serviceContext); string _mySiteUrl = _userProfileManager.MySiteHostUrl; string _profileUrl = string.Empty; int userID = 0; if (int.TryParse(Request.QueryString["id"].ToString(), out userID)) { SPUser profileUser = SPContext.Current.Web.SiteUsers.Get...

SharePoint 2010 - Current Variation / Variation Labels

If you're trying to develop a web part, which utilizes the variation title and doing so by accessing the variation labels lists in SharePoint 2010 and experiencing problems, give this function a try. I've written it to compare the accessible locales against that of the current web LCID. public static string GetCurrentWebRegionLabel() { string strLabel = "USEN"; SPSecurity.RunWithElevatedPrivileges( delegate() { ReadOnlyCollection _variations = Variations.Current.UserAccessibleLabels; strLabel = _variations.FirstOrDefault(m => m.Locale.Equals(SPContext.Current.Web.Locale.LCID.ToString())) .Title.ToString(); }); return strLabel; }

SharePoint 2010 - Document Library (checked out documents not visible to anyone)

Issue  When trying to remove folders in a document library, it appears that no files exist in the folder, yet you receive an error saying the files have not been checked in. Workaround Go to the Document Library Settings, select Manage files which have no checked in version, then select Take Ownership of Selection. This will allow you to check in the files that were missing, and remove that folder.

SharePoint 2010 / jQuery - Swapping Images

Web part uploaded and forgot to include the image in the feature? This could be a potential issue on a managed SharePoint 2010 environment (Office 365 - Dedicated, etc.). The reference points to a path in the _layouts folder. How can I temporarily resolve this issue until I update the project? Simple. Modify the master page or add a content editor web part with the following jQuery, and store the image into a location that is easily accessible. jQuery(function() { jQuery('img[src="/_layouts/images/old-image.png"]') .attr("src", "/subsite/PublishingImages/new-image.gif"); });