cofoundry icon indicating copy to clipboard operation
cofoundry copied to clipboard

Parameter in non custom entity page route

Open ernestoSerra opened this issue 6 years ago • 3 comments

Hi, I want to know if we can create pages that can get a parameter from route without query string. For example, we want to create a page that can pass a Id ( /page/{id} ). We know that it is possible for custom entity page, but is it possible for an other type of page? image If we try to add when create a page, this error is showed.

Can you help me please?

Thanks!

ernestoSerra avatar Jan 21 '19 10:01 ernestoSerra

No, you'd have to use regular MVC controllers and forgo content management on the page.

I take it you want to just ignore the parameter as you'll deal with it in the page logic somewhere and you want to have visual editor editing of content in the page, which would be the same content irrespective of the '{id}' value?

HeyJoel avatar Jan 21 '19 11:01 HeyJoel

Hi, yes we want to redirect to same page to show the same content and get the url parameters in View.

Thanks.

ernestoSerra avatar Jan 23 '19 11:01 ernestoSerra

There's a few ways that this could be resolved:

  1. Allowing parameters in dynamic routes and surfacing them somehow in the viewmodel
  2. Detaching the pages/visual editor so that it would be used from a plain MVC route

I think (2) would be a more flexible way of solving this and a few other scenarios, and it's something we'd like to have available for SPA pages too.

HeyJoel avatar Jan 24 '19 12:01 HeyJoel