Page 1 of 1

Changed to RegisterRoute, now menu not working.

Posted: Sun Mar 09, 2008 1:56 am
by Cobby
Hi,

Developing my own module and haven't had much experience with the module API. When I first started off, I was using GET variables and finding their in value the DoAction function.

I have since changed to RegisterRoute to allow for pretty URLs. That all working fine, except one part; the CMS no longer recognises that I am on the categories page (part of my module) and instead defaults to home.

What do I have to set in order for it to know what page I am on?

Code: Select all

<?php

	function SetParameters(){

		$this->CreateParameter('catid', $_GET['catid']);
		$this->CreateParameter('prodid', $_GET['prodid']);
		
		$this->RegisterRoute('/store.php\/$/', array('action'=>'default'));
		
		$this->RegisterRoute('/store.php\/(?P<catid>[0-9]+)$/', array('action'=>'viewcat'));
	
		$this->RegisterRoute('/store.php\/(?P<catid>[0-9]+)\/(?P<prodid>[0-9]+)$/', array('action'=>'viewprod'));
		

	}

?>

Cheers,
Cobby

Re: Changed to RegisterRoute, now menu not working.

Posted: Sun Mar 09, 2008 1:59 am
by calguy1000
The module api isn't very well documented in areas like this.

I'd suggest you look at the source of other modules that handle pretty urls in a better way.