Let's say I have a module GadgetSearch, with a page type in the CMS. GadgetSearch uses an XML call to gather it's data - there is no relevant database table for the search.
All is good andworks great, so long as I call /gadgetsearch/ and/or remember to change the MetaData URL entry to read /gadgetsearch/
But if I create a new page called Gadget Search, then the URL will be automatically /gadget-search/ and this fails. Is there a way to use the CMS or the controller to go to the right place? I know I could edit the config for the module, but the users can't do this...
Were have you hard coded the URL? You should use the Link() function rather than hardcoding any page URL. You could also setup a route to point a URL to a given controller (just like googlesitemaps works - https://github.com/silverstripe-labs/silverstripe-googlesitemaps/blob/0.2/_config.php#L4)
If an admin user uses the Gadget Search page type to create a new top level page, the navigation will go to wherever they specified in the Page Name by default, ie if they decide to call the page Widget Search, then by default this will go to /widget-search/ on the site from the navigation.
As I can't tell what they might call the page, how can I make sure a page of the type Gadget Search always ends up in the module folder /gadgetsearch/ ?