Set parent with resave/entries #11180
Answered
by
brandonkelly
pixelmachine
asked this question in
Q&A
-
Is it possible to set a parent with the I tried a few options like: craft resave/entries --element-id 2728 --set parent --to "fn(\$element) => \$element->getSiblings()->id(37374)->one()" It loops through the entries and saves them without error but there's no change to the parent setting. The IDs are correct and the getSiblings method returns the correct entry from the templates. |
Beta Was this translation helpful? Give feedback.
Answered by
brandonkelly
May 10, 2022
Replies: 1 comment 2 replies
-
Yeah it’s possible. Craft 3: php craft resave/entries --element-id 2728 --set newParentId --to "=37374" Craft 4: php craft resave/entries --element-id 2728 --set parentId --to "=37374" |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
pixelmachine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah it’s possible.
Craft 3:
php craft resave/entries --element-id 2728 --set newParentId --to "=37374"
Craft 4:
php craft resave/entries --element-id 2728 --set parentId --to "=37374"