I have maybe 20+ pages that I am trying to integrate from an older static site into a new MODx site. They all used the same template, will have same TVs filled out, and reside within the same container directory. I have my template built, and already manually create 2 or 3. Is there a way for me to create a CSV file maybe and post it right into the database?
Would that be advisable? Would it take me longer to figure out how to do that, as opposed to just treading forward with the manual creation of these resources?
-
☆ A M B ☆
- 24,524 Posts
Excellent! Thanks Susan. I'll give this a go.
In Revo I use the native tool, in the top menu, Content -> Import HTML.
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
Since I already have my template and TVs set up, I was thinking I could put data for additional pages into a CSV and post it to the database. Would using the native tool accomplish that?
I think it will, but you need to know the IDs of the TVs you're importing (and call the fields tv3, tv5 etc. -- where the number is the ID of the TV. I'm pretty sure the TVs must already exist.
You can do pretty much the same thing with code like this if you'd rather roll your own:
$fields['content'] = $content;
$fields['pagetitle'] = $pagetitle;
$fields['template'] = $template;
// etc.
$fields['tv1'] = $tv1;
$fields['tv6'] = $tv6;
// etc.
$modx->runProcessor('resource/create', $fields);
Thanks Bob:
This is what I was thinking. Importx that Susan suggestion also looks promising. At the moment, I'm tediously collecting all the bits of content I want to import for each resource.