Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Theme options live demo?

  1. #1
    dgwyer's Avatar
    dgwyer is online now Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default Theme options live demo?

    For some time now, for my developed themes, I have wanted to allow users to test out the theme options live, rather than just view screen shots or screen casts etc.

    I know I could easily create a separate live demo, password protect the folder, then give people access via a live demo request. I am looking for something a bit more automated though.

    I haven't much experience concerning user roles/capabilities but basically what I think would work is creating a new user capability with the same role as subscriber, then extending it slightly. I only want this type of user to have access to the usual subscriber features plus the Appearance menu theme options (all the other Appearance menu links should be hidden).

    This way I could just create a user of this type and give out the login details. The idea is that the theme options page would be fully visible, but would the user be able to save any of the theme options, seeing as they only have subscriber user capabilities.

    Has anyone else ever considered this, or tried to implement this way. Or perhaps something different?

  2. #2
    Kim's Avatar
    Kim
    Kim is offline Hello World
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    61

    Default

    Have you looked at using Justin Tadlock's Members plugin to implement this? http://wordpress.org/extend/plugins/members/

  3. #3
    dgwyer's Avatar
    dgwyer is online now Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default

    Hi Kim,

    Yes I have checked out Justin's Plugin and a couple of similar ones. The closest permission to accessing the theme menu is 'edit_theme_options'. Unfortunately this doesn't grant access to theme options page, if it exists for the current theme (the options page menu link doesn't appear for this permission). Instead, under the top level Appearance menu you only get the Themes, Widgets, and Menus items.

    These are very good Plugins but I was looking to just get the theme options page show up. Will keep on digging around..

  4. #4
    Rich Pedley's Avatar
    Rich Pedley is offline Hello World
    Join Date
    May 2009
    Location
    Liverpool, UK
    Posts
    92

    Default

    add your own role, than give access via that?

  5. #5
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by dgwyer View Post
    Hi Kim,

    Yes I have checked out Justin's Plugin and a couple of similar ones. The closest permission to accessing the theme menu is 'edit_theme_options'. Unfortunately this doesn't grant access to theme options page, if it exists for the current theme (the options page menu link doesn't appear for this permission). Instead, under the top level Appearance menu you only get the Themes, Widgets, and Menus items.

    These are very good Plugins but I was looking to just get the theme options page show up. Will keep on digging around..
    Are you calling your Settings page properly?

    For example:
    PHP Code:
    // Add "Theme Options" link to the "Appearance" menu
    function oenology_menu() {
        global 
    $oenology_admin_options_hook;
        
    $oenology_admin_options_hook add_theme_page('Theme Options''Oenology Options''edit_theme_options''oenology''oenology_admin_options_page');
    }
    // Load the Admin Options page
    add_action('admin_menu''oenology_menu'); 
    The menu entry is added via add_theme_page() according to the 'edit_theme_options' permission.

    Is yours different?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  6. #6
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    I need to do the same myself fairly soon. What I was intending to do (although I'm keen to hear of any better suggestions), was to create a few hundred test sites, then when someone clicked the "try demo" button, it would refresh the content on the site (wiping previous users entries), and take the person to the login page which would be prefilled with the username and password. Then when another person clicked "try demo", it would send them to the next site and go through the same process until it looped back on itself. By keeping the number of sites sufficiently high, no one should get kicked off the demo for many many hours.

    The hundreds of sites would all be generated via Ron Rennick's multi-site replicator plugin which lets you automatically generate perfect replicas of another site.

    I'm quite keen to hear of any better routes though as my method seems to involve far too much mucking around for my liking.

  7. #7
    dgwyer's Avatar
    dgwyer is online now Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default

    Quote Originally Posted by Rich Pedley View Post
    add your own role, than give access via that?
    That would be the easiest solution I guess, but there doesn't seem to be an available 'role' that will do this outta the box! So will need to look into this further.

  8. #8
    dgwyer's Avatar
    dgwyer is online now Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default

    Quote Originally Posted by chipbennett View Post
    Are you calling your Settings page properly?

    The menu entry is added via add_theme_page() according to the 'edit_theme_options' permission.

    Is yours different?
    Yes, that made it show up, thanks. I had it set to 'manage_options'. It now shows up along with the 'Themes', 'Widgets', and 'Menus' sub-menu items under the 'Appearance' top-level menu.

    However I still need just the theme options page to show ONLY under the 'Appearance' menu, and a way to disable the save theme options button, and display a message saying this is a demo and no theme options will actually be saved to the db (this should be fairly simple).

    Mind you, for a full demo 'experience' users would probably want to save theme options settings and see the changes made on the front end.

    Update: With this restricted user capability I can now edit the widgets and menu settings under the Appearance menu, but the theme options settings is returning an error if I try to update theme options. This is a little surprising seeing as the theme options page permissions is set to 'edit_theme_options'!?
    Last edited by dgwyer; 01-29-2011 at 08:44 AM.

  9. #9
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Have you tried the Role Scoper Plugin?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  10. #10
    dgwyer's Avatar
    dgwyer is online now Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default

    Quote Originally Posted by chipbennett View Post
    Have you tried the Role Scoper Plugin?
    Wowser, at first glance that seems to be a pretty comprehensive Plugin. Not had time to check it out completely but I'd say (tentatively!) that unless it creates some new capabilities then may not help matters significantly in this particular case.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •