Drupal maintenance support plans Bits at Web-Dev: Import nodes as as part of deployment using Hook Update Deploy Tools

With the 7.x-1.18 release of Hook Update Deploy Tools for Drupal maintenance support plans 7 it is now possible to export a node on a development sandbox, commit the export file to the repository, then import it using either a hook_update_N() or using drush site-deploy-import node
Pros:

No need to re-create a node on prod after a client approves it.
Early content that keeps getting wiped out by database snapshots (think style guides) can get re-created instantly with a single drush command.
Content imported into an existing node shows up as a revision.
Atomated deployment is testable and repeatable on all dev environments.
No uuid required.

Workflow Example:
You have a styleguide you created on your sandbox and want to deploy it to the production site.

 Create the node on your sandbox (node id = 1234).
Export the node to an export file.
drush site-deploy-export 1234

The command created an export file named  for the alias of the node being exported
ex: site-deploy/node_source/helpzZzstyle-guide.txt  (‘zZz’ represents ‘/’)
Create a hook_update_N() to import the file on deployment
 
<?php/**  * Import a the style guide */function site_deploy_update_7129() {  $nodes = array(‘help/style-guide’);  $message = HookUpdateDeployToolsNodes::import($nodes);  return $message;}?>

Commit the file and update hook to your repo.
Push the code, run ‘drush updb’

drush updb -ySite_deploy  7129  Import a the style guide
Site_deploy: Updated: node/1234: help/style-guide – successful.Summary: Imported Nodes 1/1.  Completed the following:   [help/style-guide] => Updated: node/1234   Performed update: site_deploy_update_7129
or the import can be performed by
drush site-deploy-import  help/style-guide

Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Drupal maintenance support plans Bits at Web-Dev: Import nodes as as part of deployment using Hook Update Deploy Tools

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.