ui/slider controls in CBox Theme options not rendering
- This topic has 11 replies, 2 voices, and was last updated 7 years, 9 months ago by Christian Wach.
-
AuthorPosts
-
February 14, 2017 at 1:44 pm #6216Troy WelchParticipant
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 #6218Christian WachParticipantHi 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#L205Cheers, Christian
February 22, 2017 at 11:09 am #6219Troy WelchParticipantThanks 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 #6220Troy WelchParticipantLol, 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 #6221Christian WachParticipantHi 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 #6222Troy WelchParticipantHi 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.
- 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:
- 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 #6223Troy WelchParticipantWell 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 #6224Christian WachParticipantHi 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 #6225Christian WachParticipantI 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 #6226Troy WelchParticipantThat must be a forum issue, it’s straight quotes in IDE, github and production server
February 22, 2017 at 3:49 pm #6227Troy WelchParticipantFound 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 #6228Christian WachParticipantThanks 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
- 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.
-
AuthorPosts
- You must be logged in to reply to this topic.