Apologies if this is the wrong forum. I am writing some tutorials to convert themes. I want them to all use the same content. I don’t want to have to type that content in each time. Also, I want to use separate URLs for each theme (something like wordpress.themes.modxscrolls.com). I am not sure why I want that, but I do.
My first thought was to have multiple installs of MODx all pointing at the same database (and using the same prefix). That did not work because of the File Manager Path. And after looking at the other options, I’m convinced that this is not the best solution.
Then I thought one install with multiple themes. I like this solution because it would be easy to maintain since I’d only have to upgrade one install. That didn’t work out so well because I could not figure out how to grab the domain from the URL and change the theme on the fly. Plus it seems to mess up the flow of the tutorial. I’m willing to accept that, though, if I could work out how to change the URL.
So my final thought is to create multiple installs and give each one its own database. I can set that up even though it will be a real pain come upgrade time. The problem that I am having is that I have to create the content each time I do the install. I can write the PHP to move data from one MySQL database to another. What I don’t know is which tables I should replicate, and in which order. Is there any documentation that would help or do I need to start diving into the core?
Mike
Michael Henderson
MODxCMS + Dreamhost P/S + BBEdit
Safari + Mac OS X 10.8
Did I get you question right? You just want different themes for the same site?
In this case you should have a look at the MODx example page. This provides exactly this feature:
http://0961.trymodx.com/templates.html
Bogdan, thank your for your reply. My post did wander a bit. Ultimately, I think that I will get to one site with multiple themes so you pointed me in the right direction for that. Right now, though, I need to understand how to migrate/replicate content between sites.
My approach is stand up a web site for each tutorial that I am working on. I would have a different database + directory for each site. I want all of the tutorials to share the same content. As it stands, I have to go in to each site and copy the content by hand. I would like to automate that somehow. Either by doing an export + import or writing a PHP module to move content between two databases. Unfortunately, I don’t know enough about MODx to do that. I am asking for pointers to documentation (maybe on the schema) or to the code to help me start.
Mike
Michael Henderson
MODxCMS + Dreamhost P/S + BBEdit
Safari + Mac OS X 10.8
If it’s only the basic content pages you want to duplicate then you could export the modx_site_content table from your source database via PHPMyAdmin as a dump or CSV file.
Then import it into the subsequent databases again using PHPMyAdmin
I found an example of doing the insert in the install/setup.sql script. I can use phpMyAdmin to get the export and and then I will try to update the setup.sql script to use my content. That way, every time that I create a new site it will contain my sample content. Thanks for the pointer!
Mike
Michael Henderson
MODxCMS + Dreamhost P/S + BBEdit
Safari + Mac OS X 10.8