Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Virtual Page looses functionality of original page


Go to End


3 Posts   1765 Views

Avatar
spierala

Community Member, 80 Posts

30 January 2012 at 10:24pm

Edited: 30/01/2012 10:24pm

Hello all,
For the Page Type "Page" I defined a function (myaction) in the Controller.
I can access the function normally via
http://www.mydomain.com/mypage/myaction

That just don´t work for Virtual Pages, that mirror a page of type "Page".
A call like this:
http://www.mydomain.com/my-virtual-page/myaction
will show up the "Page not found"-Page...

So somehow a virtual page doesn´t "inherit" the functions defined in the controller of the original page type?

Is there a good way to solve this?
Many thanks,
Flo

Avatar
spierala

Community Member, 80 Posts

15 February 2012 at 12:00am

Does anyone know something about that? Any help would highly appreciated :)
Florian

Avatar
inCharge

Community Member, 102 Posts

11 April 2012 at 2:47am

Hi Florian

What is VirtualPage for? I have never found a use for it, but maybe I just don't understand its purpose.

Why would you want two identical pages on a website? Sometimes I have used RedirectorPage when a page needs to appear on 2 different menus (e.g. because it's not clear to visitors where it belongs), but I'd always want it to have one master URL and one 'alias' that gets redirected. The only practical difference with VirtualPage I can see is that the URL of the copy stays in the browser address bar. In what situation would you want that?

Thanks,
Jules