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

Discrepancy in {{ record.foo }} vs {{ record.get('foo') }} #6472

Closed
bobdenotter opened this issue Mar 10, 2017 · 4 comments
Closed

Discrepancy in {{ record.foo }} vs {{ record.get('foo') }} #6472

bobdenotter opened this issue Mar 10, 2017 · 4 comments

Comments

@bobdenotter
Copy link
Member

There's a discrepancy in how these are handled.. The latter isn't output as \Twig_Markup.

Example:

    <h1>{{ record.title }}</h1>

    <hr>
    <p>record.teaser:</p>

    {{ record.teaser }}

    <hr>

    <p>record.get('teaser'):</p>

    {{ record.get('teaser') }}

    <hr>

Result:

screen shot 2017-03-10 at 17 24 01

Details

  • Relevant Bolt Version: [ 3.2 | 3.3 ]
@werner-rammer
Copy link

I experienced a (probably) similar problem: I upgraded from 3.0 to 3.2.9 and found that the HTML tags were visible in the output (the same as the reord.get('teaser') example above).
I used this in entry.twig (which worked fine in 3.0):

{{ fields(exclude = ['image']) }}

After some experimenting I modified this to:

    {{ record.teaser }}
    {{ record.body }}

i.e., include the fields explicitly. This resolved the problem (see record.teaser above).

@CarsonF
Copy link
Member

CarsonF commented Mar 19, 2017

Pretty sure this is only for repeaters, as they don't render twig/markdown or mark content as safe yet.

@bobdenotter
Copy link
Member Author

@CarsonF Look at the code example above. It's not just repeaters.

@bobdenotter
Copy link
Member Author

The discrepancy is still there, but the risk of introducing new bugs when changing this was too high, so instead we did what we did in #6474.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants