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

Blade @nocache shows NOCACHE_PLACEHOLDER #6682

Closed
stuartcusackie opened this issue Sep 9, 2022 · 2 comments
Closed

Blade @nocache shows NOCACHE_PLACEHOLDER #6682

stuartcusackie opened this issue Sep 9, 2022 · 2 comments
Labels

Comments

@stuartcusackie
Copy link

Bug description

Just experimenting with the @nocache directive for a new project.

I have a header that contains auth-based items (e.g. settings / profile) so I am using the nocache directive like so:
@nocache('partials.nav-main')

But all I am seeing is:
NOCACHE_PLACEHOLDER

The layout is a blade component but I have also tried it with a layout that uses template inheritance. Same results either way.

How to reproduce

Try the @nocache directive in blade.

Logs

No response

Environment

Version: 3.3.34 PRO
Laravel Version: 9.28.0
PHP Version: 8.1.1

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

No response

Additional details

No response

@jasonvarga
Copy link
Member

Is this on a custom route?

@stuartcusackie
Copy link
Author

stuartcusackie commented Sep 9, 2022

It is indeed! My apologies, I get it now.

I guess it's a case of adding the statamic.web middleware to my custom routes.
->middleware(['statamic.web']);

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

No branches or pull requests

3 participants