Force Include Module JavaScript

Hello,

I wasn’t able to find any documentation on this, and assume it’s an unusual request.

Since the Accordion module is rather limited, I’d like to trick rows into working as accordion items. I already have the JavaScript adding the required containers, but I’m wondering if there is a way to include the accordion init when there isn’t a standard accordion element on the page.

Thanks!

Hey Audra,

That’s a pretty cool idea! Thanks for sharing. Regarding the accordion init, I’m not 100% following you there. Can you elaborate a little more on what you need done?

Thanks,
Justin

I need the JavaScript for the standard accordion to be included on the page when I insert my custom one.

Hi Audra,

Thanks for the additional info. There’s no easy way to do that, but it can be done using wp_enqueue_script like this…

function my_enqueue_scripts() {
	wp_enqueue_script( 'my-bb-accordion', FL_BUILDER_URL . 'modules/accordion/js/frontend.js' );
}

add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts' );

That’s untested but should work. Let me know if you have any questions.

Justin