Skip to content

Issue: Variable interpolation is not working in array/list for placeholder #752

Closed

Description

@Mikescops

Describe the bug
When using a default placeholder that is an array, the variables are not interpolated inside.

To Reproduce
Create a new field in your contenttype with the following:

               {
                    "title": "aliases",
                    "name": "aliases",
                    "type": "list",
                    "default": [
                        "post/{{slug}}"
                    ],
                    "hidden": true
                }

You should get the following:

---
title: test-title
slug: test-title
aliases:
  - post/{{slug}}
---

Expected behavior
The slug variable should be rendered properly.

---
title: test-title
slug: test-title
aliases:
  - post/test-title
---

Note that using "default": "post/{{slug}}" properly renders "default": "post/test-title" so the problem is related to how array are managed.

Activity

  1. estruyf commented on Feb 12, 2024

    @estruyf
    Owner

    Thanks, @Mikescops; this is indeed not yet supported, but let us make it happen! 💪

  2. added a commit that references this issue on Feb 12, 2024
  3. estruyf commented on Feb 12, 2024

    @estruyf
    Owner

    @Mikescops was added and is testable in the latest beta version.

  4. Mikescops commented on Feb 12, 2024

    @Mikescops
    Author

    @Mikescops was added and is testable in the latest beta version.

    sounds like it broke the normal string interpolation 😓

    image image
  5. added a commit that references this issue on Feb 12, 2024
  6. estruyf commented on Feb 12, 2024

    @estruyf
    Owner

    That is correct 🤦‍♂️, should be better with the new fix

  7. Mikescops commented on Feb 12, 2024

    @Mikescops
    Author

    Much better, thanks!

    image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions