marghoobsuleman / hashtagcms

HashtagCms, Use it as Headless CMS or Bundled, API enabled, Admin Panel, multisite, multi-tenant, multiplatform, multilingual with endless possibilities. The Most powerful, fast, user-friendly and secured platform. Made with PHP Laravel Framework.
https://www.hashtagcms.org
MIT License
18 stars 4 forks source link

[Feature request] Cloning new sites from a master site (template) #21

Closed DeRaja closed 2 years ago

DeRaja commented 2 years ago

If one wants to create a new site, one has to create it manually. In this process, errors appeared due to manually cloning each elements. This issue is here: https://github.com/marghoobsuleman/hashtagcms/issues/20

From the experience of the above issue, it would be the best to provide cloning function with one click. Here are my suggestions:

After providing some basic values in a form to create a new site, the master site template will feed default values in all tables in the database and create a new site.

Here are the advantages:

Had I had created three languages and ten categories based on master site template, then I could have cloned it - for e.g. - ten new sites with one click instead of going through each area of every new site manually.

With the feature of backup, one could revert the entire database (after newly created site) to it original state manually.

I think this feature request will become a powerful function in the HashtagCMS.

marghoobsuleman commented 2 years ago

@DeRaja I've added site clone functionality. Could you please try that in new updates? it's in admin/site -> copy icon just near the Add New button.

DeRaja commented 2 years ago

Hello Marghoob,

You are amazingly fast to change the core and pour in such a powerful function into the HashtagCMS. Vowwwwww!

I looked on these changes you made to 1.3.2 patches. You changed the data loops of each data elements into site elements. I really enjoyed to see those changes. I see your excellent command on Javascripts and php coding. These two talents combined in one person. May be that is the reason why the Laravel core became so powerful, which many have yet to recognize it .

The work is so marvellous. Brilliant!

I updated in my installation of HashtagCMS 1.3.1 (dev-master) to 1.3.2 (dev-master) and got the latest patch. Thereafter, clicking on sites--->Clone sites, I got a blank page with a "Back" link on the top right.

Thereafter, I installed a fresh installation and got everything working in the HashtagCMS.

After login into the dashboard and then clicking on sites--->Clone sites, I got a blank page with a "Back" link on the top right.

In the Laravel.log, I see the following two entries (I emptied it earlier to check):

[xxx] prod.INFO: moduleInfo: {"isSuperAdmin":true,"permission":false} [xxx] prod.INFO: moduleInfo: {"isSuperAdmin":true,"permission":false}

The first line above was created when I clicked in the dashboard on the Dashboard link.

The second line was generated, when I clicked on sites--->Clone sites.

This means there is something still missing. Permissions may be? There must be something tiny that is missing. Let me know if you want me to check/debug something further. I am looking forward to cloning sites with one click!

marghoobsuleman commented 2 years ago

@DeRaja When you are SuperAdmin, you don't need permission. Fresh installation should work. Maybe assets are cached in the browser. To solve that, export config and change 'version' => env('BE_RESOURCE_VERSION', '311220210430'), to current date. say 'version' => env('BE_RESOURCE_VERSION', '011520221539')

DeRaja commented 2 years ago

Hello Marghoob,

Yes, I substituted this to 011520221539 and that did the trick. Never knew that something like this could happen and could be changed in this manner.

I thought cloning could be used for updates too:

1) Clone mastersite--->newsites 2) Extend config in mastersite (default) like languages, currencies, categories, etc. 3) Update mastersite--->clone manually newsite_one, newsite_two, newsite_three, etc.

I tried it and the MASS CREATING AND - later - UPDATING (with cloning function) works like charm!

With this method, one could configure the basics in master site and apply it to multiple new sites later. After cloning, I could create one more language, currency and apply to all existing sites from the master site.

Cloning function of basic site skeleton from a master site is really a very powerful feature. It will save a lot of time of everyone. I will play with it and let you know if there are problems. Otherwise I will close this issue.

Thanks for this powerful feature.

marghoobsuleman commented 2 years ago

Thanks for your time to look into these features. I really appreciate it. :) I love feedback.