Try our conversational search powered by Generative AI!

Selected/not selected default value not working

Vote:
 

Hi all,

I am trying to set default value for Selected/not selected property to true in Episerver>Admin>My page type>Edit property. This should create a checkbox which is checked when creating new pages using My page type. However, after creating a new page, the checkbox is still not checked. 

The same issue is with current, not new pages which use My page template.

I have tried setting  Selected/not selected property in the code behind and this worked, however, i would like to use built in functionality so i could have more control. 

I would appreciate some advise/help. Is it Episerver bug or something i am missing?

 

#65901
Feb 13, 2013 17:25
Vote:
 

Since you are trying to set the default value in Admin mode, I'm guessing your project doesn't use Page Type Builder to define page types in code? (When using Page Type Builder, the values set in code will override manual changes you make in Admin mode every time the site is restarted).

Setting a "selected/not selected" property to "true" (no quote marks necessary) should work (I just tried it on a fresh CMS 6 R2 Alloy).
But note this will only take effect for NEW pages using that page type - it will not affect existing pages. 

Are you sure you clicked the radio button next to the textfield where you can write the default value? (not the "No default value" or "Inherit" radio buttons)

#65910
Feb 13, 2013 21:42
Vote:
 

No, we dont use Page Type Builder but this pointed me to a correct direction, thanks. I tried creating a new page using Episerver menu and the checkbox was checked. However, we do create some pages programatically using CreateWritableClone, and its based on another default page, which did not have the checkbox checked. All i had to do is check it and everything worked. 

#65918
Feb 14, 2013 9:57
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.