Just a few days ago I’ve finished a very similar system (based on
Evolution) for the website of a model agency. It allowed me to make a multilingual website while keeping a single (therefore easily maintained) database of models.
The only difference is that I still used MODx to run the database, because I love how easily MODx allows me to make fields (TVs), customize the look of a form (ManagerManager plugin) and set permissions for the employees. So in my case each entry is still a MODx resource, but I call them through the database in various ways for every language.
So how would I do it:
1. Create a snippet, which would accept URL parameters and output placeholders
if (isset($_GET['region']))
{
// Don't forget to add some regexps and stuff to filter unwanted crap from the request
// Some SQL queries should be here, perhaps it can be done with the MODx DB class
// Read more http://wiki.modxcms.com/index.php/API:DBAPI
$modx->db->select(fields to select, tables, query);
// Process results into placeholders to show them on the page
$myPlaceholders['someField1'] = some_processed_result_from_db;
$myPlaceholders['someField2'] = some_processed_result_from_db;
foreach ($myPlaceholders as $key => $value)
{
$modx->setPlaceholder($key, $value);
}
}
2. Make a new template specifically for your "Regions" page. Place the snippet call in the very beginning of it, then you can place the placeholders around.
[!mySnippetCall!]
<table>
<tr>
<td>City</td>
<td>[+someField1+]</td>
</tr>
<tr>
<td>State</td>
<td>[+someField2+]</td>
</tr>
</table>
3. Don’t forget to set your "Regions" page to use the new template. By the way you may leave "cacheable" ticked, it won’t affect functionality of the snippet.
4. If your "Regions" has an alias "regions.php" (it will work without .php too), you may see test your viewer at your-site.com/regions.php?region=some_region_to_query_from_the_db
5. The second major step would be to make another snippet (or modify existing) which would generate those links somewhere, so user could follow them on the website.
I hope you get the idea.
In the end you may even modify .htaccess to enable friendly URLs for those new pages. I.e. your-site.com/regions/some_region_name
To do it, add something like this
before the standard friendly URLs part:
# Stuff for mySnippet
RewriteRule regions/(.*) regions.php?region=$1 [L]
RewriteRule regions/(.*) regions.php?region=$1 [L]
(assuming regions.php is the alias of your MODx page which uses the new template; again ".php" extension is not really needed)