November Happy Hour will be moved to Thursday December 5th.

Required Category problem

Vote:
 

I've ran into a little problem. I would like to set the selection of a category as a required property for a pagetype (it's used to categorize news subjects and needs to be set)... Therefor it should show up among the required properties once you create a page of the pagetype I have in mind. Anyone ideas on how I could solve this?

I've been trying to create a custom property rendering checkboxes (http://shahinalborz.se/2013/04/episerver-custom-property-multiple-category-checkbox-list-from-specific-sub-category/) list but I haven't yet gotten this to work with 7.5... Thankful for help!

#109823
Oct 15, 2014 14:40
Vote:
 
<p>Couldn't you add your own Category property and set it to required? Or even override the standard definition and add the required to it</p>
#111598
Oct 16, 2014 11:42
Vote:
 
<p>That sounds like a plan to me... Seems like this would be a rather common problem and I believe it has been solved before :) Could you maybe elaborate a bit about overriding the standard definition - Know of any good examples?</p>
#111623
Oct 16, 2014 16:42
Vote:
 
<p>Hmm first I thought I could just override the property Category and add the required attribute but seems that didn't work.</p> <p></p> <p>Instead lets work with the descriptor. If you use <a href="http://joelabrahamsson.com/hiding-episervers-standard-category-property/">Joel's code </a>and just add&nbsp;</p> <pre class="brush:html;auto-links:false;toolbar:false" contenteditable="false">metadata.IsRequired = true;</pre> <p></p>
#111625
Oct 16, 2014 17:15
Vote:
 
<p>Ah okey, thanks! I'll have a look at it again...&nbsp;</p>
#111762
Oct 21, 2014 9:24
Vote:
 
<p>That seems to work well! Thanks Petter...</p>
#112144
Oct 23, 2014 10:59
Vote:
 
<p>Glad I could help</p>
#112145
Oct 23, 2014 11:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.