Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect access of data properties in templates #10434

Closed
kirrg001 opened this issue Jan 30, 2019 · 0 comments
Closed

Incorrect access of data properties in templates #10434

kirrg001 opened this issue Jan 30, 2019 · 0 comments
Assignees
Labels
affects:routing related to the url service & dynamic routing features bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost

Comments

@kirrg001
Copy link
Contributor

kirrg001 commented Jan 30, 2019

Ref: https://forum.ghost.org/t/422-error-with-dynamic-route-with-longform-data-property/5268

If you are making use of data property like:

routes:
  /something/:
    data:
      categories:
        resource: tags
        type: browse

You currently need to access categories like this:

{{#foreach categories.tags}}
    {{this.slug}}
{{/foreach}}

This is a bug. It should work like this:

{{#foreach categories}}
    {{this.slug}}
{{/foreach}}

We want to add a forwards compatible change and support both syntax for now. We will drop the old and incorrect usage in Ghost 3.0

Ghost: latest

@kirrg001 kirrg001 added bug [triage] something behaving unexpectedly themes server / core Issues relating to the server or core of Ghost affects:routing related to the url service & dynamic routing features labels Jan 30, 2019
@allouis allouis self-assigned this Feb 4, 2019
@allouis allouis closed this as completed in 98b4940 Mar 4, 2019
ErisDS added a commit that referenced this issue Jan 21, 2022
refs: #10434
refs: #10449
refs: #10559

- We originally had a weird structure returned for data keys in routes.yaml.
- To the best of my knowledge this was never desired or really used
- I'm removing it now simply because I'm trying to remove all references to v2/v3 in tests, and this had a comment saying it was deprecated in v3
- I could have changed the comment to be a proper @deprecated comment and leave this til we rewrite dynamic routing
- However it's weird and confusing and I believe entirely unused - so getting rid is way way better
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:routing related to the url service & dynamic routing features bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

2 participants