Awesome plugin, transition went smoothly.
I have a question, what is the best way to add default value so that when the user activate the theme, it automatically come packed with optiontree + my options + my default value for these options.
I’ve added the entire option-tree folder in the root of my theme, I’ve added the code to reference it in my functions.php, I’ve exported my theme-options.php file, I’ve added it in the theme and referenced it in my functions.php.
When testing on a fresh WP install, option tree is there, my options are there, but they are blank and I can’t access my layouts. So the user can’t choose a predefined sets of value for the options, and they can’t upload any layouts information .. the only way is to have them install the plugin so they can import some layouts data.
Is there a better way?
Thanks!
DanyDuchaine, Derek have said:
valendesigns said
Hey Guys,I’m working on a way to export the theme options to a PHP file, should be available early this coming week. It’s a bit more than just a var_export() as I want it to include the add_action() and build a complete file like the demo-theme-options.php but with your saved settings so all you need to do is include it. You should test it and check it for errors before you use though just to be safe.
Cheers, Derek
As for default value, u can set it here http://snag.gy/BTmEe.jpg
- Attended a Community Meetup
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Envato Staff
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
DanyDuchaine said
Awesome plugin, transition went smoothly.I have a question, what is the best way to add default value so that when the user activate the theme, it automatically come packed with optiontree + my options + my default value for these options.
I’ve added the entire option-tree folder in the root of my theme, I’ve added the code to reference it in my functions.php, I’ve exported my theme-options.php file, I’ve added it in the theme and referenced it in my functions.php.
When testing on a fresh WP install, option tree is there, my options are there, but they are blank and I can’t access my layouts. So the user can’t choose a predefined sets of value for the options, and they can’t upload any layouts information .. the only way is to have them install the plugin so they can import some layouts data.
Is there a better way?
Thanks!
When you have the plugin in Theme Mode and are hiding the settings & docs the best solution would be to create your own functions that load much like the theme-options.php does. You’ll want to do a check for the ‘option_tree’ & ‘option_tree_layouts’ options and if they don’t exist load your defaults.
I’m also open to suggestions if you can think of a better way to do it that can be coded in and make your life easier. It’s a community project so suggestion are always welcome.
Cheers, Derek
- Attended a Community Meetup
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Envato Staff
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
dekciw said
Is there a way to prepopulate list-item option, with list items which have different settings in them?![]()
Are you referring to theme options or meta boxes?
Maybe add some options to turn on/off some area in theme mode, like layouts import for example. No idea how this would be done though.
- Attended a Community Meetup
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Envato Staff
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
DanyDuchaine said
Maybe add some options to turn on/off some area in theme mode, like layouts import for example. No idea how this would be done though.
That could get weird, but I’ll look into it.
valendesigns said
DanyDuchaine saidThat could get weird, but I’ll look into it.
Maybe add some options to turn on/off some area in theme mode, like layouts import for example. No idea how this would be done though.
Thanks .. Maybe an import button next to the input where the user can create new layout at the moment.
- Attended a Community Meetup
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Envato Staff
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
DanyDuchaine said
valendesigns saidThanks .. Maybe an import button next to the input where the user can create new layout at the moment.
DanyDuchaine saidThat could get weird, but I’ll look into it.
Maybe add some options to turn on/off some area in theme mode, like layouts import for example. No idea how this would be done though.
That’s what I was thinking, as well. The issue is we have a lot of ways to use the plugin and we need to make both plugin and theme mode as easy to use as possible without conflicting with each other. I’m going to look into having an import only page but it may be to crazy to do without introducing bugs or a lot of confusion. However, import layouts works in plugin mode if the old 1.x files exist in the ‘option-tree’ directory in the themes root. So the old style of auto import works, but theme mode is where we need to come up with a good solution that works well for everyone.
valendesigns said
dekciw saidAre you referring to theme options or meta boxes?
Is there a way to prepopulate list-item option, with list items which have different settings in them?![]()
Theme options.
- Attended a Community Meetup
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Envato Staff
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
dekciw said
valendesigns saidTheme options.
dekciw saidAre you referring to theme options or meta boxes?
Is there a way to prepopulate list-item option, with list items which have different settings in them?![]()
Are you asking to have a list item inside another list item? If so, the answer is no, not at this time, sorry! If not, can you clarify the question.
