Pretty urls with other page behind it

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
jurrie
New Member
New Member
Posts: 9
Joined: Fri Feb 10, 2012 6:35 pm

Pretty urls with other page behind it

Post by jurrie »

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
Last edited by Dr.CSS on Wed Jun 05, 2013 3:41 pm, edited 1 time in total.
Reason: Please use double quotes on fake links so they aren't clickable...
Post Reply

Return to “Developers Discussion”