Seeding blocks #2363
Unanswered
stuartmcgill
asked this question in
Q&A
Seeding blocks
#2363
Replies: 1 comment
-
Actually I've just found this on Discord i.e. to call |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a separate question about seeding, and wondered if anyone could give me a push in the right direction. I'm trying to seed (for production) a singleton module (a
PrivacyPolicy
) with some text-only blocks (no media or files). I've got as far as the following, where$blocks
is just the JSON fromtwill_blocks.content
in my test environment.This sort of does the job, but I feel like there must be a better way... This is relying too much on Twill internals, and also doesn't create a revision.
I tried hooking into what the admin front-end does when it saves a block (e.g. directly calling
afterSaveHandleBlocks()
onPrivacyPageRepository
), but I couldn't get this to work either.Thank you (again) in advance for any help you can give.
Beta Was this translation helpful? Give feedback.
All reactions