For one page, render as another page

I have another question connected to my previous javascript routing questions.

I am wondering if it is possible to get a page to render as its (grand)parent but maintain the same url. The “Catch all” solution given by @patric.forsgard worked great, but the last piece needed is one scenario where I actually have “data”-pages which URL should be used, but if they get a visit they should render as the grand parent and let javascript routing handle the page.

I’ve tried letting the child grab the parent and rendering with parentcontroller and parent data and making updates to the PageRequestData.Current but I assume that change is “too late” in the process since I’m not getting the correct page in CurrentState.Current.PageID

Another solution would be to move the data-pages and then the catch-all would pick up, but since it’s a page that have been live for years, I’d rather not move around that much pages unless its the only solution.

Hope the question makes sense… :grimacing:

Litium version: 6.3.7

Could you set the new page for the request with CurrentState.Current.SetOnNewPage()?

Did not know of that method! Unfortunately nothing changed when calling it :frowning:

Actually, that function did something, a part solution of which I was able to get what I need working. The last bit that didn’t change was

@Html.Action("Head", "Layout")

The “Page” injected through that function must come from some other mechanism (or maybe cached) since that didn’t change, but I could just use whatever was in “CurrentState” instead.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.