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

Can't render Antlers in content #1798

Closed
edalzell opened this issue May 5, 2020 · 3 comments · Fixed by #4257
Closed

Can't render Antlers in content #1798

edalzell opened this issue May 5, 2020 · 3 comments · Fixed by #4257
Labels

Comments

@edalzell
Copy link
Contributor

edalzell commented May 5, 2020

Bug Description

I have the following in a nav structure:

    title: '© {{ misc:organization_name }}. All Rights Reserved.'

In my template I have this:

{{ title }}

Which outputs:
image
If I do this instead: {{ title }}{{ misc:organization_name }}, I get:
image

How to Reproduce

  1. Create a global with some data.
  2. Create a Nav item whose title references the above global
  3. In a template, reference the nav and that item's title

Environment

Statamic version: 3.0.0-beta-28

PHP version: 7.4

Install method (choose one):

  • Fresh install from statamic/statamic
@jackmcdade
Copy link
Member

What do you mean by "...unless you do?"

@edalzell
Copy link
Contributor Author

In the second example it seems to work if I have another tag there? See the example? If I only do {{ title }} it doesn't render the global, but if I also render the global on it's own then it works in both spots.

@jasonvarga
Copy link
Member

Notes for later:

  • Adding antlers: true to the field (title, in your case) will render the global.
  • You have to drop that global in your template to trigger the magical reappearance. Dropping any global isn't enough.

@github-actions github-actions bot added stale and removed stale labels Jan 7, 2021
@jackmcdade jackmcdade changed the title Can't render Antlers in content...unless you do? Can't render Antlers in content Jul 5, 2021
@statamic statamic deleted a comment from github-actions bot Feb 10, 2022
@statamic statamic deleted a comment from jelleroorda Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants