-
☆ A M B ☆
- 3,141 Posts
MODx makes friendly urls for the resources - the pages.
So you’ll want the addon he’s made to be called on a resource (named Businesses with businesses as alias). That page will most likely contain a snippet call that either gets the information of the business, specified by the businessid GET paramater, or show an overview of some sorts.
Now, you’ll need some rewriting to achieve your friendly urls with the business title in the link... that’s something I’m not sure about how to achieve. I do know that you can have an url rewrite that simply fetches an ID out of your url and use that, while ignoring the rest.
So you could do /businesses/12345/some-name-here.html, which modRewrite parses to become /businesses.{friendlyurlssuffix}?businessid=12345. It simply ignores the some-name-here.
As a side note: you could’ve simply added all business listing as a resource within MODx and use something like Ditto or getResources for Revo to list them, while using a template to display the details, to keep everything in MODx and make use of the native Friendly URLs system.
-
☆ A M B ☆
- 3,141 Posts
I think with authoring a plugin he means writing it.
The code he posted should go into a new plugin, which fires on the "onPageNotFound" event.
You’d have to make the links manually and modify the plugin code you quoted to look for a business instead of a tshirt, but then you’ll be good to go?
-
☆ A M B ☆
- 24,524 Posts
Elements -> Manage Elements -> Plugins
Oh! Nifty...I’ll take a look at this now and let you guys know if I get this to work.
-
☆ A M B ☆
- 24,524 Posts
I found that article on google yesterday, but the admin panel looks nothing like that.
Page updated.