Some thoughts on programming stuff

Month: June 2018

Get web URL from document URL in SharePoint

Maybe you need to get web URL from document URL in SharePoint, or even just grab the Site Collection URL and do some awesome logic and update some data in your site. But you are aware that it can be costy and require some array splits, substrings and those kind of tricks. So here is a code snippet to save your time to enjoy a good cup of coffee with your colleagues!

The document URL usually is composed by a site collection part, the specific web part, the Library name and then the final part containing the folders and the file name. The script basically will perform a request to a SharePoint API. Our parameter is the folder or library URL (cutting the filename) that will be made automatically. Finally, the result will come with the Web and Site Collection urls for that context.

Get web URL from document URL in SharePoint - A bunch of files in folders inside drawers (SharePoint)
A bunch of files in folders inside drawers (SharePoint) (Source: Howtogeek)
Continue reading

How to delete a SharePoint site

When a SharePoint subsite is not necessary anymore, you may need to delete it. So how to delete a SharePoint site? This tutorial will help you on deleting that site! Oh, needless to say that you can restore it from the Recycle bin if you want, for a period of time.

Before you advance to the method itself, it’s important to say what is a SharePoint site. There’s a lot of misconceptions between the words Site Collection and Sites. Even the SharePoint Admin interfaces calls a Site Collection as “Site” sometimes.

According to Microsoft documentation the sites objetive can be described like the paragraph below:

“You create sites in your site collection to partition your content so that you can have finer control of the appearance and the permission to the content. You can also have different features available on the various sites in your site collection. You can use a site template with its default configuration, or you can change the site’s default settings through site administration, and then save the site as a new template”.

It’s nice to share that there’s another name to a SharePoint Site from a Dev perspective, we call it a SPWeb.

Continue reading

How to open SharePoint settings?

It may sound basic to teach how to open the SharePoint Settings page, but it can help someone that is stepping inside the SharePoint world for the first time. Also this post will be used for referencing purposes in other step-by-step tutorials, reducing the post size for those who need to do or access something inside the Settings page. That’s why this post will cover how to open SharePoint settings.

Te settings page allows you to do a lot of things! According to Microsoft docs: “Once you’ve created a site in SharePoint Online or SharePoint Server, you can make changes to the settings, information, and permissions for the site.”. You can also define some advanced settings if you are a site owner or site collection administrator.

Continue reading

© 2024 wiliammbr's blog

Theme by Anders NorenUp ↑