Drupal 7

Drupal 7 uses a hook system. Our module provides several hooks which you can implement in your module and code for the needed functionality. You can find details on how to implement hooks and about creating a custom module on drupal.org. We provide the opportunity to extend the module using the following hooks:

  • hook_gathercontent_pre_node_save_alter – You can change all node properties and perform various operations with them before the node is saved in Drupal. A node doesn’t have a node ID while calling this hook. Menu items and meta tags aren’t saved/created while calling this hook. For operations requiring a node ID see hook_gathercontent_post_node_save_alter.
  • hook_gathercontent_post_node_save – You can change all node properties and perform various operations with them after the node is saved in Drupal. A node has a node ID while calling this hook. Menu items and meta tags are already saved/created while calling this hook.
  • hook_gathercontent_pre_node_upload_alter – You can change the configuration or node before it’s uploaded to GatherContent.
  • hook_gathercontent_post_node_upload – You can change all node properties and perform various operations with them after the node is uploaded to GatherContent.
  • hook_gathercontent_post_import – You can use this hook to create relations between nodes or create various statistics about imports and updates. You can fetch type of operation from Operation entity.
  • hook_gathercontent_post_upload – You can use this hook to create relations between nodes or create various statistics about uploads. You can fetch type of operation from Operation entity.

Drupal 8

Drupal 8 uses an event system. Details about how to implement events can be found here. Our module provides the following events:

  • gathercontent.pre_node_save – This event allows modules to perform an action before a new node is saved from GatherContent to Drupal. The event is triggered just before the entity saves. The event listener method receives a DrupalgathercontentEventPreNodeSaveEvent instance.
  • gathercontent.post_node_save – This event allows modules to perform an action after a new node is saved from GatherContent to Drupal. The event is triggered after menu item creation. The event listener method receives a DrupalgathercontentEventPostNodeSaveEvent instance.
  • gathercontent.pre_node_upload – This event allows modules to perform an action before a node is uploaded from Drupal to GatherContent. The event listener method receives a DrupalgathercontentEventPreNodeUploadEvent instance.
  • gathercontent.post_node_upload – This event allows modules to perform an action after a node is uploaded to GatherContent from Drupal. The event is triggered only after successful upload. The event listener method receives a DrupalgathercontentEventPostNodeSaveEvent instance.
  • gathercontent.post_import – This event allows modules to perform an action after selected nodes are imported from GatherContent to Drupal. The event listener method receives a DrupalgathercontentEventPostImportEvent instance.
  • gathercontent.post_upload – This event allows modules to perform an action after selected nodes are uploaded to GatherContent from Drupal. The event listener method receives a DrupalgathercontentEventPostUploadEvent instance.
Did this answer your question?