themovation / th-widget-pack

Theme Widget Pack
19 stars 6 forks source link

Theme Demo Importer #106

Closed ryanlabelle closed 7 years ago

ryanlabelle commented 7 years ago

Hello @adiraomj , I'm hoping that you can help us get the Demo Importer working for our new theme.

I found a script that I think will work, I've got it to a certain point but need some help carrying it forward. If you have any suggestions or alternatives please let us know.

https://github.com/dtbaker/envato-wp-theme-setup-wizard/tree/master/envato_setup

I've already got embedded in the theme and most of it is working, but we need to add a few steps:

There are a few minor bugs after this but for the most part it's working well.

Here is some documentation: https://github.com/dtbaker/envato-wp-theme-setup-wizard More: https://forums.envato.com/t/fully-automatic-plugin-install-default-content-oauth-theme-updates-in-a-wizard/20504/67

The main class is Envato_Theme_Setup_Wizard inside envato_setup.php and I've been extended the class inside envato_setup_init.php . He's provided some custom code examples in envato_setup_init.php where we can do all our extending.

You can find the wizard under Appearance / Set Wizard.

Thanks

ryanlabelle commented 7 years ago

Also, we don't need to get the Envato Authentication / Theme Update step working just yet, you can skip that.

adiraoco commented 7 years ago

It's ready for Formidable Forms.

Please test. Let me know if you come across any bugs.

If you need to make changes to the demo content, just replace the formidable-forms.xml file. https://github.com/ryanlabelle/westwood/blob/master/plugins/envato_setup/content/formidable-forms.xml

ryanlabelle commented 7 years ago

Thanks. I'll test today :)

ryanlabelle commented 7 years ago

Hi @adiraomj the forms import well, the only things is that now the widget and demo content does not. Is this something you are still working on?

If the json files are provided in the setup folder then they need to be run as well as the formidable items.

https://cl.ly/3m3m252d1O3N

If we can get both working together then we are looking good. :)

ryanlabelle commented 7 years ago

You can generate these on your local using this:

If you add &export=true to the URL of the first page setup wizard it will output the required json data into the envato_setup/content/ folder, it will also put media files into a local images/stock/ folder.

RE: https://github.com/dtbaker/envato-wp-theme-setup-wizard

adiraoco commented 7 years ago

I'll get the widget and demo content ready next.. I'm having a little problem getting master slider working..

ryanlabelle commented 7 years ago

And master slider isn't includdd with the content json? If not we can try and tackle that last. Not as important as forms , content and widgets

adiraoco commented 7 years ago

I have made changes.

Also all the content will now be checked by default.

Removed Contact Form 7 and added tours.

ryanlabelle commented 7 years ago

I'll test this out :)

ryanlabelle commented 7 years ago

Wow. Looking great. There are a few minor things but for the most part it's looking good. :)

ryanlabelle commented 7 years ago

I'd like to get the Main Menu automatically set to the primary, right now it's not set.

https://cl.ly/3Y0r400t2i0O

https://cl.ly/3F3u1E2s3M11

ryanlabelle commented 7 years ago

The issue of tour types not showing has been resolved :)

ryanlabelle commented 7 years ago

Just the navigation issue.

adiraoco commented 7 years ago

Done.

Change the name of the main menu to the name of your demo menu. I have named it Main Menu now. https://github.com/ryanlabelle/westwood/blob/master/plugins/envato_setup/envato-setup-export.php#L157

Looks like it works fine. Let me know if there are any bugs. Thanks

ryanlabelle commented 7 years ago

Thanks!

Can we also remove these options from the import?

Custom css My library Styles Form Actions Products Events Option Tree

Thanks.

ryanlabelle commented 7 years ago

I should have most of this completed today. :) I'll have an update for you today.

ryanlabelle commented 7 years ago

I committed some changes but I still need to review. There are a few minor updates to make and then we can ship this feature. :)

ryanlabelle commented 7 years ago

Still working on this one. it's almost done.

ryanlabelle commented 7 years ago

Okay, the import script has been cleaned up and I create a function and hook to find and replace tour terms because when imported they get new ID's and the tour grid wasn't showing correct posts. Looking good now.

ryanlabelle commented 7 years ago

Just needs some testing. :)