baumrock / RockMigrations

The Ultimate Automation and Deployment-Tool for ProcessWire
MIT License
34 stars 10 forks source link

Docs improvement suggestion (lacks info) #58

Closed donatasben closed 6 months ago

donatasben commented 6 months ago

Hi, I was trying to find but couldn't (I could swear I have seen it, but probably on RM1) info how to correctly use the $rm->migrate(['fields'=>[]]) to create reapeaters. More specifically - set their fields. I found no examples in the docs. GitHub Wiki shows:

Docs moved to https://www.baumrock.com/en/processwire/modules/rockmigrations/docs/

But there are no mention of repeater fields in those docs.

Also I couldn't find how to use migrate structure to create pages: how to set required fields, how to maybe set page field data. I was experimenting with it, but ran into some trouble. I found out that if the template is different from already existing page (name, path, etc. - identical. Want to just change template) - it created a new page instead of changing existing. Could changing page template via "migrate" made possible in the future?

BernhardBaumrock commented 6 months ago

Thx, I've added https://github.com/baumrock/RockMigrations/blob/dev/docs/repeaters/readme.md - does that help?

donatasben commented 6 months ago

Thanks! It helps. Noticed there's a missing letter "R" in the title - "Migating Repeaters" Maybe it would be a nice addition to also mention or show one example, that repeater field array can be associative arrays with assigned context settings.

And what about creating/editing pages via migrate()? It could also benefit from some clarifications of what makes the page identify as already existing, how parents can be set (needs ID, path, selector?)

BernhardBaumrock commented 6 months ago

LOL, just realized i pushed the instructions to the AI instead of the finalised texts :) I've fixed that and added an example of field context, thx.

Regarding creating/editing pages: I'm not using that often. I think it relies on the page name to identify the page. But that feature needs some love one day. Now we also have the once() feature, which is great. That means you can create the page once and then if it exists do whatever you want with it.

I'd appreciate if you need that feature if you add some docs and maybe help to improve it. Docs are really just readme files in the /docs folder. They will be added to my website automatically.