Closed (fixed)
Project:
Node import
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2007 at 13:40 UTC
Updated:
20 Feb 2007 at 10:00 UTC
I just created book.inc in "supported" folder as follows and it is importing the content as "page"
function book_node_import_types() {
return array(
'book' => t('Book'),
);
}
/**
* Implementation of hook_node_import_fields().
*/
function book_node_import_fields($type) {
if ($type == 'book') {
return array(
'title' => t('Title'),
'body' => t('Body'),
);
}
}
How i can import the Parent, page title, input format with this. Please guide me
Comments
Comment #1
Robrecht Jacques commentedFor parent links, look at following example from
content.inc:Basically you would do the same in
book_node_import_prepare(), only to assign the foundnidto$node->parent.So the steps for parent links is:
- add a
"node_import_book_parent" => t('Book: Parent link')tobook_node_import_fields(),- in
book_node_import_prepare()you lookup thenidfor$node->node_import_book_parentsimilar to the code above and assign it to$node->parent.I'll look into the body format myself as this is probably needed for page.inc and story.inc too.
I don't understand what you mean by page title. Isn't this just "Title" ?
Comment #2
incom commentedThank you for the update. I mean "Title" is the page_title_module field.
i am not expert in php, however i modified the book.inc as follows and it is wworking and adding the 'parent' to book page.
But to get the teaser, i have to update again even though i assigned 'published, promoted to front page' - please correct/modify the following book.inc and add it in your next update -
Comment #3
Robrecht Jacques commentedFixed in 4.7.x-1.3.
Please open another issue for your problems with published and promoted to front page.
Note that the format used is the default format - I'll work on that for a later release.
Comment #4
Robrecht Jacques commentedSupport for page_title.module has been added in 4.7.x-1.4.
Comment #5
(not verified) commented