Pretty urls with other page behind it
Posted: Wed Jun 05, 2013 12:15 pm
Hello everyone,
In a module I created, I have a pretty url like this:
/mymodule/page/<PageID>
PageID is a variable that points to the content id of the page I want to show.
Furthermore, I have created multiple pages. Say I have a page with page alias 'test' and content id 59. Then the code in my module will be (simplified):
$this->RegisterRoute('/mymodule\/page\/59$/', array('returnid' => 59));
When I visit "http://localhost/test I see the page like I want. But when I visit "http://localhost/mymodule/page/59 I only see the template, not the content of the page itself. So I'm going about this the wrong way.
How to get the pretty URL /mymodule/page/59 to display the same as /test ??
This is only the first step, so I can't use other modules like ContentAlias I'm afraid... (In the end, I want to have the page content be dynamic based on parameters I define in the pretty url, but that's a next step. First I need to get this to work.)
Thanks in advance for any help.
With kind regards,
Jurrie
In a module I created, I have a pretty url like this:
/mymodule/page/<PageID>
PageID is a variable that points to the content id of the page I want to show.
Furthermore, I have created multiple pages. Say I have a page with page alias 'test' and content id 59. Then the code in my module will be (simplified):
$this->RegisterRoute('/mymodule\/page\/59$/', array('returnid' => 59));
When I visit "http://localhost/test I see the page like I want. But when I visit "http://localhost/mymodule/page/59 I only see the template, not the content of the page itself. So I'm going about this the wrong way.
How to get the pretty URL /mymodule/page/59 to display the same as /test ??
This is only the first step, so I can't use other modules like ContentAlias I'm afraid... (In the end, I want to have the page content be dynamic based on parameters I define in the pretty url, but that's a next step. First I need to get this to work.)
Thanks in advance for any help.
With kind regards,
Jurrie