Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX Classic Support

Public Group active 4 months ago

This group provides support for Commons In A Box Classic, our original software for community-building. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

ui/slider controls in CBox Theme options not rendering

  • This topic has 11 replies, 2 voices, and was last updated 8 years, 2 months ago by Christian Wach.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • February 14, 2017 at 1:44 pm #6216
    Troy Welch
    Participant

    Hi, any of the setting items in CBox theme settings that use the type = “ui/slider” as specified in the /engine/config/options.ini are not showing the ui/slider. Specifically it is being rendered in HTML as type=”hidden”

    Any thoughts on how I can fix this? Or failing that, the setting I need at the moment is the timing and duration for the Homepage image slider, maybe there’s a way to set that directly.

    Cheers,

    Troy

    February 22, 2017 at 7:27 am #6218
    Christian Wach
    Participant

    Hi Troy, you can modify any of the setup arguments with a filter:

    /**
     * Customise the CBOX Slider setup arguments.
     *
     * @param array $args Existing setup arguments.
     * @return array $args Modified setup arguments.
     */
    function my_flex_slider_controls( $args ) {
    	$args['speed'] = 1000;
    	return $args;
    }
    add_filter( 'cbox_flex_slider_controls', 'my_flex_slider_controls' );
    

    The code shows you the full list of options that can be modified:
    https://github.com/cuny-academic-commons/cbox-theme/blob/master/engine/includes/feature-slider/setup.php#L205

    Cheers, Christian

    February 22, 2017 at 11:09 am #6219
    Troy Welch
    Participant

    Thanks Christian, our project launches in a few days so this will get me sorted on that front. I’ll pursue the larger issue of the ui/slider controls not appearing after the heat is off launch.

     

    Cheers,

    Troy

    February 22, 2017 at 11:26 am #6220
    Troy Welch
    Participant

    Lol, curiosity got the better of me and I had a look in my sandbox install of CBox where the controls are rendering fine and compared the code with the production version where the ui/slider controls are not rendering in the options area.

    Here are two snippets of the rendered code, just the div around the control:

    Working:

    <div id="cbox_flex_slider_time-tabs-1" aria-labelledby="ui-id-9" class="ui-tabs-panel ui-widget-content ui-corner-bottom" role="tabpanel" aria-expanded="true" aria-hidden="false">
     <p>The amount of time in seconds each slide shows</p>
     <span class="ice-title">
     Time in seconds:</span>
    <span class="ice-content">5</span>
    <div id="icext-c92bdfe9_widget" class="ice-controls ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all ice-slider">
     <input type="hidden" name="cbox_flex_slider_time" id="" class="" value="5"> </div>
    
    </div>

     

    Not working:

    <div id=”cbox_flex_slider_time-tabs-1″ aria-labelledby=”ui-id-11″ class=”ui-tabs-panel ui-widget-content ui-corner-bottom” role=”tabpanel” aria-expanded=”true” aria-hidden=”false”>
    <p>The amount of time in seconds each slide shows</p>
    <span class=”ice-title”>
    Time in seconds:</span>
    <span class=”ice-content”>
    <!– formatted values injected here –>
    </span>
    <div id=”icext-c92bdfe9_widget” class=”ice-controls”>
    <input type=”hidden” name=”cbox_flex_slider_time” id=”” class=”” value=”5″> </div>

    </div>

    I’m not sure if the forums will filter the code out or not, I’ll dig into this a little more later, possibly a plugin conflict.

    Cheers,

    Troy

     

    February 22, 2017 at 11:36 am #6221
    Christian Wach
    Participant

    Hi Troy, it looks to me like your CBOX CSS and JS files need rebuilding. Put the following in your wp-config.php file:

    define( 'INFINITY_DEV_MODE', true );

    Then reload a page (any page will do) and remove the code above. Then see if your CBOX Theme Options work as expected again.

    If you want to force the controls to show, add the following to the function I posted above:

    $args['controls'] = true;

    Your controls should then show up regardless of whether the Theme Options page works correctly or not.

    Cheers, Christian

    February 22, 2017 at 12:16 pm #6222
    Troy Welch
    Participant

    Hi Christian, thanks for the tips, I just want to check that we are talking about the same thing as there are two uses of the word “slider” in play.

    1. Slider: the thing that displays a slide show of pictures on the home page. This is working/displaying just fine, including the controls for moving to different slides, although a little fast for people to read the text in the overlays. The function you have me above will slow this down nicely.

      Normally, this can be done on the options page using:

    2. UI/Slider controls. These are what is not rendering (none of the several that should appear in the theme options area). The shift back to Dev mode (I had it on during the majority of development and turned it off about a week back) has not solved this problem. Correct me if I’m wrong, the controls argument applies to the display slider (1 above).

      In the code I provided above, in the version that is not working, it appears that some data instead of the “formatted values injected here” comment and several classes and other tag attributes are missing in a div tag, and an anchor tag is missing.

    In any event, #1 is what I’m actually trying to do at the moment and I can get on with it. #2 makes me a little uneasy (well, and it makes options adjustments more difficult) and I would like to solve it as well, but there is more time.

    Cheers and thanks,

    Troy

    February 22, 2017 at 12:58 pm #6223
    Troy Welch
    Participant

    Well that’s strange, I added the following function to functions.php and start getting white screened with http 500 error.

    /**
    * Set slider options to workaround missing UI elements in theme options
    */
    function eple_flex_slider_controls( $args ) {
    $args[‘pause’] = 5000; // in milliseconds
    return $args;
    }
    add_filter( ‘cbox_flex_slider_controls’, ‘eple_flex_slider_controls’ );

    I’ve commented it out for the moment as other team members need to work on the site. I’ve proofed it against your original suggested function several times and don’t see where I might have gone wrong.

    Any thoughts?

    February 22, 2017 at 1:04 pm #6224
    Christian Wach
    Participant

    Hi Troy,

    • #1 should be solved with the my_flex_slider_controls() function which allows control over all the front-end slider settings.
    • #2 is usually solved by regenerating the CBOX JS, but if you say that it isn’t working then I’d agree that you probably have a plugin conflict.

    Keep us informed of how you get on!

    Cheers, Christian

    February 22, 2017 at 1:11 pm #6225
    Christian Wach
    Participant

    I added the following function to functions.php and start getting white screened with http 500 error.

    If the code is exactly as you posted, then it looks like you have curly quotes rather than straight quotes. Your code works for me with straight quotes.

    Cheers, Christian

    February 22, 2017 at 1:42 pm #6226
    Troy Welch
    Participant

    That must be a forum issue, it’s straight quotes in IDE, github and production server

     

    February 22, 2017 at 3:49 pm #6227
    Troy Welch
    Participant

    Found the plugin conflict:

    https://en-ca.wordpress.org/plugins/agp-font-awesome-collection/ 

    Removed it and all is fine.

    Thanks so much for your time and help Christian.

     

    Troy

    February 23, 2017 at 7:56 am #6228
    Christian Wach
    Participant

    Thanks for reporting this Troy. I seems to be because AGP loads a more recent version of jQuery on all admin pages. Useful to know.

    Cheers, Christian

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX Classic Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 287
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register