Generating TXT files from Globals #7345
Unanswered
glitchbox42
asked this question in
Q&A
Replies: 1 comment 1 reply
-
What you've done seems to work fine here. What's not working? If you wanted to swap getting content from a config to a global, you can do this: $set = GlobalSet::find('settings')->inDefaultSite();
$content = $set->robots_content; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been playing around with Statamic and was wondering if there's a way to generate txt files from a global set.
For example, the humans.txt or robots.txt files. I just can't seem to get it to work—I know, it's definitely me.
This is what I've got so far:
I created a 'robots.antlers.html' and placed it inside resources/views. I then added the following route to the web.php file under routes/.
'robots.antlers.html':
{{ $content }}
'web.php' file:
Beta Was this translation helpful? Give feedback.
All reactions