Try our conversational search powered by Generative AI!

Open New page from code/Query string

Vote:
 

Hi

our client asked if we can open the new page directly without pressing the new page button ?

thier vision was sending links to content editor where it opens new page in a specific location,

did someone have any idea how to tackle this issue ?

using EPi 9 latest

#142641
Dec 17, 2015 10:48
Vote:
 

I don't think there's a built-in URL that does that.

Without plugging in any custom javascript you could just pass the user by your own code that creates a new unpublished page and then redirects to it's edit URL.

#142643
Dec 17, 2015 11:11
Vote:
 

the issue is that we have [Required] attribute on specific properties.

so when create new page from code i have to set values, but the content editor will forget to add them , so i remove Required and then they don't now what to edit ( again it's the massive number of editors we have).

#142644
Dec 17, 2015 11:34
Vote:
 

How about adding a custom validation to the properties that should be required?

http://henrikm.com/custom-episerver-property-validation/

#142645
Dec 17, 2015 11:59
Vote:
 

this is what we toguht is the solution but not sure if the content editor will like and also i will have to check if values are accroding can be null when creating

#142646
Dec 17, 2015 12:12
Vote:
 

Getting a "create new" URL that works from anywhere from somewhere in Epi would be a good feature request.

#142648
Dec 17, 2015 12:54
Vote:
 

Hello!

Unfortunately there's no such an URL to a specific page for adding content. If you look in DeveloperTools you'll see that the request when you click on the "create new page" looks like this http://your_site/EPiServer/cms/Stores/contenttype/?query=getavailablecontenttypes&parentReference=5&requestedTypes=episerver.core.pagedata which is of no use.

If you want to be a bit more creative you could do have a page that does the following: (this would be the link you would send to the editors)

1 - Create an unpublished page that you popuplate with dummy text, in the case of required properties.

2- Populate a custom property with a message to the editor indicating which properties contain dummy text and should be changed. This custom property should be declared in your base page for page types and the point would be to display a custom message to the editors, in red fore color so it's visible. The property would only display a label or something using Dojo when it has a value and nothing when it's empty. Then you populate the property when you create your page . When the page is published the first time you empty the property.

3- Redirect user to edit mode for the newly created page.

It's not the simplest or nicest solution but it should work, at least so your editors don't miss changing the dummy text you've written in your required properties. I don't see any other way of achieving what you need.

/Kenia

#142732
Dec 21, 2015 14:14
* 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.