Obviously, you can import your data in Drupal from different data stores (e.g a database table(s), flat file, etc.) but the emphasis here is that we are importing WCI content therefore XML or JSON might be the most appropriate industry standard intermediary formats. ![]() There are other Drupal node properties that you can also set before saving the node $node -> status = 0 //default is 1 for published or not $node -> promote = 1 //default is 0 meaning not promoted to front page //Save the node node_save( $node) Įcho "Employee node with node id " $node-> nid. Need to format the date field $node-> employe_birth_date = gmdate('Y-m-d H:i:s', $node -> employee_zipcode = $employee-> zipcode $node -> employee_state = $employee -> state $node -> employee_city = $employee -> city $node -> employee_address = $employee -> address The PHP import script would be: employee as $employee) $node -> employee_telephone = $employee -> telephone We would first create an "employee" content type in Drupal and then write the PHP script to import the XML feed into the “employee” Drupal node (make sure to save the script somewhere inside your Drupal install directory. So, for example, building off our previous example of the employees XML feed that has these data elements: 1 I usually use drush cex to export the config in my local enviroment and drush cim to import this config in other enviroment. So the first thing when considering Drupal as a Web Content Management (WCM) is to structure your site first in terms of its different content types. These different content types have different data elements or fields. Odds are your web presence is more than just static content you might have pages with content such as products, vendors, blogs, press releases, events, etc. The most basic content is, well, of type “Basic page” that has a couple of fields: a title and a body. Drupal is content driven, that is the rendered HTML is populated from a number of different content types stored in a database. So, now, let’s discuss how to import that content in Drupal. And in a separate blog, we explored how to expor t Publisher content as an XML feed. ![]() In that same blog, we discussed one route to export WCI’s knowledge directory documents and each document’s properties using a JSON feed. I wanted to blog about something exciting and relative to the current hour such as "who will win the coming presidential race to the Whitehouse", especially that the first presidential debate of 2012 is looming (personally I think Jim Lehrer is pretty lame and would have preferred to see Oprah Winfrey conducting these debates.) But my friend Vasanth hinted that the topic isn’t quite inline of Function1’s blogging policy and that we should be politically correct (whatever that means.) My argument that is built in Drupal and that we aren’t really deviating from a technical topic landed on deaf ears! Oh well back to the technical jargon :-) We posted a couple of blogs on Drupal and its merits, and why it is a strong alternative to WebCenter Interaction (WCI).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |