同行
我有一些静态 html 内容,它们是 120000 个文件。我想导入所有文件并将单个文件内容存储为节点。通过将节点标题作为 html 文件名和节点主体作为 html 文件内容,如何做到这一点?
问候
同行
我有一些静态 html 内容,它们是 120000 个文件。我想导入所有文件并将单个文件内容存储为节点。通过将节点标题作为 html 文件名和节点主体作为 html 文件内容,如何做到这一点?
问候
Here are two solutions you might wanna look up. However, both are for Drupal 6. You might wanna build the site in Drupal 6, and then upgrade to Drupal 7 if you cannot find a solution for D7. It might be easier and faster than doing it directly in Drupal 7
The latter one seems to be made to work with HTML pages.
Cheers
P.S. Just found this other solution Drupal Migrate
您可以轻松地制作这样的脚本:
$node = new stdClass();
$node->type = 'youtype';
node_object_prepare($node);
// Get Your title ...
$node->title = $title;
$node->language = LANGUAGE_NONE;
// Get Your body content
$node->body[$node->language][0]['value'] = $body_content;
为每个文件创建一个循环,脚本将需要一些时间来运行。