How to I set the parent category in GPM?

I have the following in my gpm.yaml file (using it to create my package in MODX 3.1.2-pl)
All categories are created and cta section does get rank 5, but is not added below the ‘homepage’ category…

How to I set the parent category in GPM?

categories:
- name: search
- name: homepage
- name: cta section
  rank: 5
  parent: homepage

Hoi Menno :slight_smile:

This changed in GPM for MODX 3.. Instead of referring to the parent, you need to list nested categories as children. Here’s an example:

      - name: e_information
        children:
          - name: e_info_action
          - name: e_info_creativework
            children:
              - { name: _About, rank: 150 }
              - { name: _Comments, rank: 151 }
              - { name: _Contributors, rank: 152 }
          - name: e_info_event
          - name: e_info_intangible
            children:
              - { name: _Contact, rank: 100 }
              - { name: _Address, rank: 101 }
              - { name: _Date, rank: 102 }
              - { name: _Rating, rank: 110 }

Hope it works!

1 Like

Thanks! This works great:

categories:
  - name: general
    rank: 1
  - name: blog
    rank: 2
  - name: faq
    rank: 3
  - name: contact
    rank: 4
  - name: social
  - name: search
  - name: homepage
    children:
      - name: cta section
        rank: 1
      - name: news section
        rank: 2

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.