Pattern Syntax: Node

Last modified: April 2, 2009 - 05:13

Node component allows you to add, edit and delete nodes. It supports all the standard node edit form elements except menu. Taxonomy and CCK fields are also supported.

If menu item needs to be created for the node, separate menu_item action should be used.

Valid elements for "node" action

  • type - content type of the node
  • nid - node ID - required if you want to edit existing node
  • id - alias for nid
  • title - node title
  • body - body text
  • teaser_js - summary text if "Show summary in full view" is checked
  • format - input format for body text
  • teaser_include - "Show summary in full view" (values 0 and 1)
  • status - published
  • promote - promoted to front page
  • sticky - sticky at top of lists
  • comment - (values: 0 - disabled, 1 - read only, 2 - read/write)
  • name - authored by (valid Drupal username)
  • author - alias for name
  • date - authored on (format: 2008-01-03 12:56:55 +0100)
  • language
  • revision - create new revision (values 0 and 1)
  • log - log message for new revision
  • taxonomy
  • fields - CCK fields

Valid elements for "taxonomy"

  • vocabulary - name of the vocabulary
  • term - term name
  • taxonomy_overwrite - when updating the node, delete all previously set terms before adding new ones, by default old and new terms are merged together

Examples:

Vocabulary with "Multiple Select" not checked (nodes can have only one term from vocabulary):

    taxonomy:
      - vocabulary: Status
        term: In Progress

Vocabulary with "Multiple Select" checked (nodes can have more than one term from vocabulary):

    taxonomy:
      - vocabulary: Skills
        0: Custom Module Development
        1: Usability Testing
        2: Theming

Vocabulary with "Tags" checked (terms created by users):

    taxonomy:
      - vocabulary: Skills
      - term: keyword1, keyword2, keyword3   

Valid elements for CCK fields

    fields:
      # text/text_textfield (single value)
      company_name: Example Company
     
      # text/text_textfield (multiple values)
      company_name:
        - value: Example Company 1
        - value: Example Company 2             
     
      # text/optionwidgets_select (single value)
      industry: telecom
     
      # text/optionwidgets_select (multiple values)
      industry:
        value:
          telecom: telecom
          it: it     
     
      # email/email_textfield
      email: info@example.com
     
      # link/link
      website:
        url: http://example.com
     
      # link/link (single value)
      demo_site:
        title: Demos and Examples
        url: http://demos.example.com
     
      # link/link (multiple values)
      demo_site:
        - url: http://example1.com
          title: Example 1
        - url: http://example2.com
          title: Example 2
     
      # text/text_textfield
      phone_number: (555) 555-5555
     
      # text/text_textarea (single value)
      address:
        value: |
          1234 Fifth Avenue
          California
        format: 1
     
      # text/text_textarea (multiple values)
      # NOTE: specify format first, otherwise it gets treated as a part of a value element
      address:
        - format: 1
          value: |
            address 1 line 1
            address 1 line 2
        - format: 2
          value: |
            1234 Fifth Avenue
            California
     
      # date/date_popup
      established:
        value: 2008-09-09
     
      # nodereference/nodereference_select (single value)
      primary_contact:
        nid: 3
     
      # userreference/userreference_select (multiple values)
      sysadmin:
        uid:
          4: 4
          3: 3
     
      # number_integer/optionwidgets_select
      num_employees: 500
     
      # text/optionwidgets_buttons
      features:
        value:
          1: 1
          3: 3
     
      # number_integer/optionwidgets_onoff
      public: 0
     
      # viewreference/viewreference_select
      posts:
        view_id: 9
        arguments:
     
      # viewfield/viewfield_select
      testimonials:
        vname: tracker|default
        vargs: 1

 
 

Drupal is a registered trademark of Dries Buytaert.