Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

Why the /Forms/ folder is your friend

I’ve been working with custom views for a few years now and one thing seems to always come up … Where to put those pesky resource files?    Images, JavaScript, User Guide PDF, all of these I’ve used in one way or another.    Tweaking DispForm.aspx is a past time of many SharePoint developers but how many know of a proper place to drop their resource files?     The /images/ folder of the web is intriguing but leads to a disconnected management experience.   What if this list is deployed to another site with a duplicate file of the same name?  (naming conflicts)

 

I will submit the idea that the hidden system folder /Forms/ is a great place for these for four simple reasons:

  1. Easy to find – Yes, I get lost on my own sites.   Don’t you?   Having the resources nearby makes management a breeze.
  2. Relative URL hyperlinks – No need for server relative or hardcoded URL reference.    From DispForm.aspx (for example) just call “resource_file.ext”
  3. Protected from end users – They can’t delete what they can’t see.   Enough said.
  4. Bundled as .STP for list templates – When you save any SPList as STP it will automatically package up the entire contents of the /Forms/ folder.   How cool is that!?!    So easy to migrate, duplicate, and even control source version history by saving often.    This alone is reason to use this technique.

 

So the next time you’re adding custom files to a particular list please give the /Forms/ folder a second look. 

Hot

 

image

 

image

 

image

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲