URL Overview

blindmime
@blindmime
10 years ago
772 posts
I'd like to see documentation on the construction of Jamroom URLs. I feel like I sort of understand it, but then I don't fully. How do they work to display content from different modules, search, profiles, etc.?

For example, if my profiles have custom fields State and City, is there a URL that would list profiles in Los Angeles, California which contains "Los Angeles" and "California" in the URL? Like mysite.com/profile/ss/city/los%20angeles/state/california.
updated by @blindmime: 05/27/15 11:38:20AM
brian
@brian
10 years ago
10,149 posts
So basically how routing works is (in order of priority):

- http://site.com/template - run "template.tpl" from the active skin

- http://site.com/module_url/view_function - run the "view_function" view function from the module with the module_url

- http://site.com/module_url/magic_view_function - run the "magic_view_function" magic view function FOR the module with the module_url

- http://site.com/profile_url - load the Profile with the profile_url

In your example there is search capabilities on the "indexes" for module that use a datastore - a module index is:

http://site.com/module_url

This will load the modules/ModuleName/templates/index.tpl file. That file for a lot of the modules has built in search capabilities, so you could do:

http://site.com/module_url/ss=search_string

i.e.

http://site.com/profile/ss=brian

But that is only supported on the module index and the module must be a DataStore module.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags