Some thoughts on programming stuff

Tag: SharePoint (Page 2 of 4)

Get thumbnail URL programmatically in SharePoint

SharePoint Picture Libraries offer an out-of-box feature for image compression and optimization, specially when working with thumbnails. After uploading an image to a Picture Library, you will be able to get an optimized version and thumb version just calling the same image using an specific URL pattern. In this blog post we cover a simple JavaScript function that lets you get picture thumbnail URL programmatically in SharePoint.

First, it’s important to say what is a thumbnail! According to Wikipedia, “Thumbnails are reduced-size versions of pictures or videos, used to help in recognizing and organizing them, serving the same role for images as a normal text index does for words”.

It’s extremely useful when you need to develop a custom web part to present an image inside a Library and you want to save bandwidth for your users at the same time that your site has better performance too. Working with the thumbnail version of your images will let SharePoint handle cache and performance in a more efficient way, making your system more reliable and faster.

Image result for thumbnail image example
Example of thumbnail usage (Open Berkeley)

So how to get the picture thumbnail URL programmatically in SharePoint?

Generating the thumbnail URL

Explanation of thumbnail URL feature in SharePoint

Basically it works transforming a given string in another one that respects the pattern required to generate the URL. You just need to pass an image URL that is stored inside a Picture Library. It will transform an URL like the example below and you can get thumbnail URL programmatically in SharePoint:

In addition to that, if you are working with images you may end up facing some problems with Image Renditions. Maybe this post is for you!

References:
StackOverflow

Storage Metrics in SharePoint

If you are managing a SharePoint site and need to find out how much space is it using, this post will help on finding the Storage Metrics in SharePoint. You can access this information easily, but it’s required to have SharePoint Site Collection admin rights.

The SharePoint Site Collection admin rights is able to do a lot of things, he is a real Super User and is more powerful than the Full Control permission level. You can access things like the Storage Quota and manage Site Collection Features that are more advanced and complex.

The task this post teaches how to do is very common administrative task for people who support SharePoint solutions and need to control if a subsite or library is getting bigger and if it needs to a new architecture to allocate and distribute the resources in a better way.

Continue reading

Export Workflow History to CSV in SharePoint

Sometimes you may need to export Workflow History to CSV in SharePoint, just because most of the history data is not available anymore in the Workflow History page of a document or item, thanks to the SharePoint Workflow Auto Cleanup that purges the data for performance purposes.

But what happens if someone is trying to make an audit review and cannot find the history for a specific document? Well… you can use this script!

Export Workflow History to CSV in SharePoint - Audit and reporting of document history
Audit and reporting of document history
Pxhere
Continue reading

Update SEO Properties in SharePoint programmatically

Last month, I had to make a bulk update of SEO properties from Pages in one of our customers website that runs SharePoint 2016. Basically we needed to update every property that was empty based on an Excel spreadsheet. This file defined the Keywords and Meta Descriptions for each area of the site. In this post I’m going cover how to update SEO Properties in SharePoint programmatically!

Continue reading

Canonical Tags in SharePoint

Since its 2013 version, Canonical Tags in SharePoint are supported by default if you enable the Publishing Feature. You can also use Managed Navigation to have Friendly URLs and make your canonical tags look awesome!

These Canonical URLs are important to help Search Engines on their task for categorization, simplifying tracking metrics and consolidating links and references that may have different URL formats, but point to the same page. You can find more info in this post.

Continue reading

To export a list you must have a Microsoft SharePoint Foundation-compatible application

SharePoint lists and libraries can be exported to Excel using a out-of-box functionality, but unfortunately SharePoint may present an error message like: To export a list you must have a Microsoft SharePoint Foundation-compatible application.

Putting it in simple words, it’s requiring that you must use Internet Explorer to export the list or you must update your SharePoint site (through a KB or a complete version change) because you are probably using a browser like Chrome or Firefox. . But let’s assume that you don’t have time for that and just want to have the file at that moment? Then we have a quick tip for you! So you finally will get rid of those messages “microsoft sharepoint foundation compatible application” blah blah blah.

The terrible message
Continue reading

SharePoint and Information Rights Management

Information Rights Management or IRM is a subset of features and procedures to protect sensitive information from unauthorized access. As we know, SharePoint is document-driven, so everyone expects that platform can help you on protecting data with out-of-box options.

Hopefully SharePoint has it! Allowing you to add policies at Document Library level that persists even after the document was downloaded and isn’t at SharePoint context anymore, so I must say the IRM SharePoint is very powerful! Furthermore, it’s important to say that IRM policy will work only at library level!

Image by geralt via Pixabay.com
Edited by me

Because I’ve had to understand the feature more deeply, considering what could be done by users that only have Read access to libraries, I’ve decided to test how the IRM feature works and then wrote a document trying to identify what are actions were available, depending on what you configure.

Continue reading

Edit Rendition invisible in the Ribbon

If you happen to have the Edit Rendition invisible in the Ribbon in SharePoint and you did everything right when setting up the environment and enabling Blob Cache in your SharePoint site. Don’t worry, this blog post will help you with simple trick!

Image renditions are great when you want to provide content in different screens using specific dimensions to help people crop the image or focus in what matters most when presenting it. It’s not common to have problems with them as they add great value to your solution.

Complementing, Microsoft documentation says: “Image renditions enable you to render a single image in multiple ways. An image can be displayed in various sizes or with different cropping. The first time that an image is requested, SharePoint Server uses the specified image rendition to generate the image. When a user views a SharePoint site, the correctly sized version of the image is downloaded to the client computer. This reduces the size of the file that is downloaded to the client, which improves site performance. “.

Edit Rendition invisible in the Ribbon - Button invisible
Edit Renditions button not showing
Continue reading

Force Flush Blob Cache in SharePoint

If you need to force flush blob cache in SharePoint, this script is for you! It will ensure that every file once cache will be deleted and will force SharePoint on recreating it when it sometimes becomes corrupt.

After running this script, you will get back on track and the cache will be flushed. But be cautious! This script will only affect the server where it’s being executed. In cases where you have multiple web application servers working together, the script must be executed in each server. It is necessary because each server holds its personal folder where the assets will be stored and cached.

The Blob Cache is an important feature that must be used when you have heavy traffic with lots of anonymous users, or even if you need to explore Image Renditions (we have a blog post about some problems there too). You can find over the internet a lot of content about it, but I must say that exists some undocumented stuff about the topic that may have been lost in the history and it’s just present in some old books about SharePoint.

The Script to force flush Blob Cache

All the steps below are important to get things working again. Basically our script will delete the Folder where you have configured the Blob Cache to store the files, then we will call the Flush Blob Cache method offered by the SPWebApplication object from SharePoint. Finally, the iisreset is an important step because it will ensure that the everything is rewinded and refreshed.

That’s it! I hope this script can help you getting things on track, perfoming a force Flush Blob Cache in SharePoint and serving a good SharePoint Site with awesome performance to your users.

References:
Karine Bosch blog;
Microsoft documentation.
« Older posts Newer posts »

© 2024 wiliammbr's blog

Theme by Anders NorenUp ↑