WordPress.org

Ready to get started?Download WordPress

Forums

OptionTree
Theme Integration (34 posts)

  1. Ruven
    Member
    Posted 3 years ago #

    Really cool and easy to use plugin!

    I was just wondering, if I can also integrate it into a theme, so the theme users don't have to deal with plungin installation and data import. I would like to provide out of the box functionality. So as soon as the user activates the theme, he should have the theme option menu with all the options ready to start.

    Is that pollible now or in future versions?

    Thank you.

  2. _rg_
    Member
    Posted 3 years ago #

    +1

  3. Derek Herman
    Member
    Plugin Author

    Posted 3 years ago #

    It would take a huge overhaul to make THIS code a class you could just plugin into WordPress. I know some of you think that is ideal, but how would updates be distributed to the community?

    I could look into it but I can't promise anything. I have a lot of work to do on the OptionTree container site and Envato is launching a few new projects I need to finish soon so making this a class will have to wait till I have a moment of free time, sorry.

    I promise I will look into it though.

  4. ghostpool
    Member
    Posted 3 years ago #

    Wow, this is excellent plugin Derek. I'll add my +1 to this thread.

    I have managed to integrate the plugin into the theme so it doesn't require activation via the plugin directory, all I need to know now is, is there a page I can insert my options code into in the following form for instance:

    array(
            'item_id' => $item_id,
            'item_title' => $item_title,
            'item_desc' => $item_desc,
            'item_type' => $item_type,
            'item_options' => $item_options,
            'item_sort' => $id
          )

    I tried adding something similar to where the Test Input field is inserted in class.admin.php, but it doesn't seem to work. Is the plugin not capable of this type of customization in it's current form?

  5. Derek Herman
    Member
    Plugin Author

    Posted 3 years ago #

    I've thought of some ideas for making this more theme developer friendly. I'll work out my idea and hopefully if time permits have it updated next week.

    It's not going to be a class but will allow a sort of hidden default array.

  6. vauvarin
    Member
    Posted 3 years ago #

    Great job Derek, very usefull plugin !

    GhostPool, did you right a post to explain how integrate Derek's plugin into the theme ? I'm very interesting.

    Thank you

  7. vauvarin
    Member
    Posted 3 years ago #

    ... did you write ... sorry

  8. ghostpool
    Member
    Posted 3 years ago #

    All you need to do is refer to the index.php file that comes with the plugin in functions.php e.g.

    require_once (TEMPLATEPATH . 'option-tree/index.php');

    Then remove the references to the plugin directory from index.php:

    define( 'OT_PLUGIN_DIR', ...
    define( 'OT_PLUGIN_URL', ...

    And add this to functions.php:

    define( 'OT_PLUGIN_DIR', get_template_directory_uri() . '/lib/admin/inc/option-tree');
    define( 'OT_PLUGIN_URL', get_template_directory_uri() . '/lib/admin/inc/option-tree');

    Obviously replacing it with your own directory structure.

  9. vauvarin
    Member
    Posted 3 years ago #

    Sorry but i've got a problem, i'm not php developper, just a designer ;-)

    So i did that :

    I putted the option-tree folder in my theme folder: MyTheme > option-tree

    I commented this two lines in the option-tree index.php

    // define( 'OT_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
    // define( 'OT_PLUGIN_URL', WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) );

    I added this in my functions.php theme

    require_once (TEMPLATEPATH . '/option-tree/index.php');
    define( 'OT_PLUGIN_DIR', get_template_directory_uri() . '/option-tree');
    define( 'OT_PLUGIN_URL', get_template_directory_uri() . '/option-tree');

    The first line seems ok, i think the problem comes from the second and third line of code.

    Result :

    I see the option-tree box in my left admin sidebare but the center of the page is empty (no forms in the center of the admin page) but just this message display : "No direct script access allowed"

    Any idea of my mistake ?

  10. ghostpool
    Member
    Posted 3 years ago #

    Make sure you did not remove the version number reference from index.php e.g.

    define( 'OT_VERSION', '1.1.1' );
  11. vauvarin
    Member
    Posted 3 years ago #

    My version number reference in index.php is ok and not comment.

    Maybe you might send me your index.php and functions.php to compare with mine.

    gillesvauvarin[at]gmail[dot]com

    Thank you for your help.

  12. OllieMcCarthy
    Member
    Posted 3 years ago #

    @GhostPool and @vauvarin - did you figure out what was wrong? I have followed the same proceedure and get some warnings referring to class.admin.php

    Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\wamp\www\startup\wp-content\themes\silverpoint\option-tree\classes\class.admin.php on line 372

  13. OllieMcCarthy
    Member
    Posted 3 years ago #

    I got it to work. I used TEMPLATEPATH to link up the frontend files on the lines where the warnings referred.

  14. dejanc
    Member
    Posted 3 years ago #

    +1

  15. VladNovo
    Member
    Posted 3 years ago #

    I'm also interested in inserting option code manually. Have anyone already done it?

    array(
            'item_id' => $item_id,
            'item_title' => $item_title,
            'item_desc' => $item_desc,
            'item_type' => $item_type,
            'item_options' => $item_options,
            'item_sort' => $id
          )
  16. mydearvalentine
    Member
    Posted 3 years ago #

    Thanks for the solution I was also looking for the same ...

  17. Bainternet
    Member
    Posted 3 years ago #

    @GhostPool and @vauvarin
    did you solve the
    "No direct script access allowed"
    issue?

  18. since83
    Blocked
    Posted 3 years ago #

    Full theme integration would be just pure AWESOMENESSSSSS. Would liek to see a options for developers to comment out the documentation and settings pages for end users also. Being able to add pages with just text and images would be nice for liek info on using the theme or somehitng... if this isnt already in there.

  19. since83
    Blocked
    Posted 3 years ago #

    I got it to work without errors but no CSS or images are working.

  20. Derek Herman
    Member
    Plugin Author

    Posted 3 years ago #

    I'll be updating the plugin again later this week to accept a default XML file in your theme so options are not added via the admin panel. It's the best solution for keeping the plugin updated on every site/theme using OptionTree without creating a separate non plugin framework.

  21. Juan Federico Reinoso
    Member
    Posted 3 years ago #

    Also a INPRODUCTION option will be nice, so when its activate (via functions.php) the documentation and settings are disabled.
    define(OPTION_TREE_INPRODUCTION, "yes");
    Something like that.
    I hope im clear, thanks in advance.

  22. Paul de Wouters
    Human Made
    Posted 3 years ago #

    yes, would be nice to be able to hide the documentation and settings menus when the site is shipped to client

  23. Jason Bahl
    Member
    Posted 3 years ago #

    I also ran into the "No direct script access allowed" issue. . .

    Here's what I had to change:

    In the class.admin.php page there are 3 spots where I changed

    OT_PLUGIN_DIR.'/front-end

    to

    TEMPLATEPATH . '/option-tree/front-end

    Hopefully that helps minimize someone's troubles.

    I think this plugin is AWESOME and having the ability to have it built in to a theme is even more AWESOME!

  24. Saroj
    Member
    Posted 3 years ago #

    THIS CODE WORKS WELL FOR ME (for css/images issue)

    require_once (TEMPLATEPATH . '/lib/plugins/option-tree/index.php');
    define( 'OT_PLUGIN_DIR', TEMPLATEPATH . '/lib/plugins/option-tree');
    define( 'OT_PLUGIN_URL', get_template_directory_uri()  . '/lib/plugins/option-tree');
  25. Derek Herman
    Member
    Plugin Author

    Posted 3 years ago #

    Later today there will be a new version that has the ability to integrate with a theme and hides the settings and docs pages while pulling in the theme options from an XML file on install or upgrade. Also, the options data will be populated from a TXT file for new installs.

  26. Flaunt Books
    Member
    Posted 3 years ago #

    That's really great Derek.

    I am curious if you would be interested in some development I've done on your 1.1.6 version that allows a user to save settings into an alternate array (option) to have easily accessible layouts that can be activated / deleted / exported.

    The purpose of coding this was to allow a client to easily manage several designs for their site within the Options Tree Settings without have to export / import txt files.

    Just a simple click of the mouse let's a user save the current settings as a new design and then create / activate / delete & export many more of them.

    We also added some action hooks into a few places that allow more control over the internal processes.

    Let me know as I would be happy to share it with you and the community.

  27. Derek Herman
    Member
    Plugin Author

    Posted 3 years ago #

    @skooks I would love to see what you've done contact me derek[at]valendesigns.com and we'll see about integrating your changes into OptionTree.

  28. warpol
    Member
    Posted 2 years ago #

    @Derek, awesome work with the plugin, it's been pivotal in the new theme we've been developing.

    I'm +1 for integrating the plugin directly into a theme as opposed to a plugin. Updates are not a big deal for users and, in fact, are a liability. For those of us extending your work, It's best for the developer to release updated themes with OptionTree built in rather than risk a new version of OptionTree destroying any current settings/mods.

    We've also branched off some new features. One implements a checkbox toggle to show/hide additional options. Another implements full image upload insertion in the slider option (before you had to directly type in the file path to the image). Now you can use the image library to insert pictures. Let me know if you'd like the code.

  29. Flaunt Books
    Member
    Posted 2 years ago #

    @Derek, I second the awesomeness of this plugin.

    @warpol, I would love to get the code for the full image upload insertion.

  30. Derek Herman
    Member
    Plugin Author

    Posted 2 years ago #

    @warpol Yes send me the code and an explanation of where you changed it and what it's doing and I'll add it to the core.

    Send it to derek[at]valendesigns[dot]com.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic