Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Require user to use specific asset folder for image property on page


Hi all,

I'm looking for an answer to the following question (or at least where to look in the forums/documentation, as I havent had any luck yet.):

I want to require a content author to select/upload images from a specific folder for a specific ContentReference property w/ UIHint.Image  on a page type. Basically the situation would be having a shared folder for a page type to store images in under the For All Sites media folder, for example: /For All Sites/LandingPage/SomeLandingPageSpecificImageFolder . 


Jan 05, 2016 22:42

Heres an example of the code im working with that hopefully should be more clear.

Name = "Page Banner",
Description = "The image appearing in the hero area.",
GroupName = SystemTabNames.Content,
Order = 300)]
public virtual ContentReference PageBanner{ get; set; }

I'd have a folder called /For All Sites/Landing Pages/Page Banners

I'd like to require the user, when editing the property PageBanner to be required to select an image or upload to the mentioned folder.

Jan 05, 2016 22:46

I suppose you could solve this using Custom validation. Here is a couple of examples:

Jan 06, 2016 8:45

Hello Timothy

I have not tried this with image selection but I think this post on changing the root for content references may contain the answer you are looking for:

Let me know how you get on.


Jan 06, 2016 12:03

That sounds like a much better way to handle it than custom validation :-)

Jan 06, 2016 12:22

I think thats pretty much exactly what I was looking for David, thank you very much. I figured this would be built in but it seems like a simple enough solution.

Jan 06, 2016 15:07
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.