Renaming slice sections

While creating a custom type using the Slice Machine, if you add slices into the Slice Zone across multiple taps, the data within the slice zone needs to be referenced as slice, then slice1, then slice2, etc.

You can see this demonstrated in the custom type here:

{
  "id": "navigation",
  "label": "Navigation",
  "repeatable": true,
  "status": true,
  "json": {
    "Navigation": {
      "slices": {
        "type": "Slices",
        "fieldset": "Slice Zone",
        "config": {
          "choices": {
            "menu": {
              "type": "SharedSlice"
            },
            "link": {
              "type": "SharedSlice"
            }
          }
        }
      }
    },
    "Buttons": {
      "slices1": {
        "type": "Slices",
        "fieldset": "Slice Zone",
        "config": {
          "choices": {
            "button": {
              "type": "SharedSlice"
            }
          }
        }
      }
    }
  }
}

From a development perspective, slices and slices1 is not very descriptive. Is okay to change this value?

An example would be:

{
  "id": "navigation",
  "label": "Navigation",
  "repeatable": true,
  "status": true,
  "json": {
    "Navigation": {
      "navigation": {
        "type": "Slices",
        "fieldset": "Slice Zone",
        "config": {
          "choices": {
            "menu": {
              "type": "SharedSlice"
            },
            "link": {
              "type": "SharedSlice"
            }
          }
        }
      }
    },
    "Buttons": {
      "buttons": {
        "type": "Slices",
        "fieldset": "Slice Zone",
        "config": {
          "choices": {
            "button": {
              "type": "SharedSlice"
            }
          }
        }
      }
    }
  }
}

I did give it a shot but only so far as changing the names in the custom type JSON and refreshing Slice Machine - everything seemed to work. I didn't push these changes to Prismic or anything for fear of breaking something.

Would it be safe to do? Will everything continue to work as normal?

cheers,
Scott.

Hello @scott3!

Yes, you can change the names of the tabs, but please keep in mind that making other abrupt changes that can be done from the Slice Machine interface can cause conflicts when synchronizing changes with your repository.

Hey @Pau,

Thanks for getting back to me.

Yeah, that's why I didn't commit the change because I didn't want to screw it up. Would Prismic consider making updates to the UI to allow this and making this an option that you will support?

cheers,
Scott.

1 Like

I can add your comment as a feature request. If there are ever any changes we'll post it on the progress page What's new - Prismic