Jump to content

Dev Module to setup Default "New PW"


Recommended Posts

Hi Folks,

I am lost and stuck !

 I like to setup several domains with ProcessWire - MultiLanguage. All Pages should have the same basisconfiguration and Fieldsets. Its a messy job to setup each domain manually, so my idea was to develop a module , which setup my basis templates + fields + fieldsettings (visuality / dependencies / fieldsets) automatically.

But I have no idea how to start and what to start with.

All modules I looked at, mostly do something for front-end jobs. But this is an install-module.

How to create a module which:

  • create fields and fieldsets and its dependencies (is there a cheatpage for all possibilities ?)
  • create template Pages which implements above fields

If someone could give me an easy implementationhint :-) it would be sooooo nice. Maybe there is already something I could look at for learning.

Thanks a lot

Michael

--

Using PW 3.0.62

Link to comment
Share on other sites

2 hours ago, BitPoet said:

Why not set up the first site (or a kind of template site), run Site Profile Exporter, copy the created profile into the install package and run the regular installer with that profile for the subsequent domains?

More on this here by @Robin Shttps://processwire.com/talk/topic/16350-processwire-and-phpstorm/?do=findComment&comment=145018

You can also clone "your default site" easily with: https://modules.processwire.com/modules/duplicator/ by @flydev
Keep in mind that using Duplicator you will get the same $config->userAuthSalt which is a minor security issue but you can apply the workaround suggested by @horsthttps://processwire.com/talk/topic/15265-generate-new-userauthsalt-for-copied-site/?tab=comments#comment-136537

 

 

  • Like 2
Link to comment
Share on other sites

22 hours ago, LauschZone said:

How to create a module which:

  • create fields and fieldsets and its dependencies (is there a cheatpage for all possibilities ?)
  • create template Pages which implements above fields

This is exactly what can be done with the migrations module. It totally depends on his usecase what is the best option.

That it is not maintained does not mean that it does not work ;) It's only some helper functions around pw's API - and you know how often the api changes... almost never ;)

Maybe copying over site profiles is the best option. But maybe he needs more flexibility then the other options could be handy. And maybe he wants to maintain all of those websites lateron, then site profiles would be totally useless whereas migrations could be shared across the single instances and modify them as needed.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...