Thursday, July 26, 2018

Group By Content Type in Modern Lists and Libraries

IMO, this should be an easier thing to do. It’s a VERY common request from my clients, and for years we’ve had to hack this together. There are currently two UserVoice items about it that I can find – here and here – but not nearly enough votes to get on the radar of the product team. You can help me fix that, right? Vote early, and vote often!

Ideally, in the modern view, we should be able to simply click on Group by Content Type in the UI. No joy there. We get that option for virtually every other column type – including the dread Managed Metadata column!

No big deal, right? We’ll just go into the view settings and add the grouping. Nope. Never was going to happen. Content Type is missing from the list of columns in the dropdown.

 

Luckily, in the second of those UserVoice items, a wonderful person named Eric Ivarsson gives us the trick we need to make this work. I worry about tricks like this because they could always stop working, but this one seems to have worked for a while now (at least a year), so I’m willing to use it and recommend it.

If you simply add this query string to the end of your view:

?groupBy=ContentType

you will get a view which groups by Content Type. You don’t even have to be displaying the Content Type column for this to work. If you have other groupings in place YMMV, but it accomplishes the main requirement here.

Make sure the “B” in groupBy is capitalized, or it won’t work.

You can then save the view from the UI, and even use the same view name. The setting will become embedded in the view (somehow) and you’ll be all set.

Again, if you use this trick, please vote up the two UserVoice items so that we can stop using it.


by Marc D Anderson via Marc D Anderson's Blog

No comments:

Post a Comment