Before you can import a book, you need to install a module call 'Node Import' in Drupal. This module allows Drupal to import and update content from CSV or TSV files. To install this module, simply go to drupal site and follow the instructions on the website to download it. Once this is done, then you need to copy the downloaded module to the 'modules' directory on the Drupal server. For example if your Drupal is located in /var/www/html/drupal/
directory, then you should copy the module to /var/www/html/drupal/sites/all/modules/
directory. To enable the installed module, login to the Drupal site and go to Administer -> Site building -> Modules . In the Development section, tick the and click button to activate the Node Import Module.
You also need to enable the following Drupal core modules:
Book
Menu
Path
Please consult your web adminstrator if you don't have permission to install module in drupal.
Import directory - Where the CSV files to be imported are stored. The default path is sites/default/files/imports/
.
FTP settings
Allow FTP uploads - Make sure the checkbox is checked, so that the new CSV file can be auto-detected when it is uploaded into the import directory
.
File owner - The CSV file that you uploaded to the import directory
will be assigned ownership to this user.
Users will only be allowed to use files they have uploaded themselves and files owned by anonymous. If you leave this field blank, all files uploaded by FTP will be owned by anonymous and so all users will see those files as being available for them. If you enter a username here, files that are uploaded using FTP will be owned by that user and only that user will be able to see those uploaded files. It is recommended to leave this field blank.
Allowed extensions - The allowed import file's extension. Other extensions will be ignore by the module.
Default settings
Content type - The default content type that will be used for quick import. Make sure the Book Page content type
is checked.
First row contains column names - This tells the node import module that the first row of the csv file is the headers.
To import book into Drupal:
Follow the steps in Section 1, “How to build a CSV file for Drupal import”
Upload the CSV file to import Directory
in the Drupal Server
Upload en-US
directory to the "sites/default/files/"
directory in the Drupal server. This value can be overriden in the publican.cfg
. For more details, please read Section 2, “The publican.cfg file”
Login to the Drupal website, and go to Administer -> Content management -> Import content. You will see the CSV file that you just uploaded is showing in the 'Pending Tasks" table and it is ready to import.
Click
to start importing book. You will be redirect to the next page which is showing the import progress. When the progress bar hit 100%, that means the import is done!The book link should be showing in the specified menu block now.
Simply repeat the steps in Section 3.3, “How to import book” to update the book.
If you update the book with smaller chunks, than the missing chunks will be deleted by Drupal and the URL path for the deleted chunks will be deleted as well.