Custom subscribe form module based of the existing module

About this forum
These forums have not been active for several years. They're available for search and reference, but a lot of this information is likely out of date.

For current information, try visiting our Knowledge Base.

Home / Support / Custom Module Development / Custom subscribe form module based of the existing module

This topic is: resolved
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #56846

    Johan
    Participant

    Hi There,

    Been a firm user of this wonderful plugin for some time now.

    I have a project that initially needed a customized version of the Subscribe Form module.
    I Followed the instructions and made modifications to it as described in the documentation “Overriding Built-In Modules” and it worked great!

    Now I need to use a new Subscribe Form module but this have to be like the default, so i guess i have to take the custom one I made and make it into a plugin. I have done so following the documentation but for some reason it is not showing up in the builder after registration. I have checked under pagebuilder settings if the module is included, but also here it is not showning.

    What I have basically done is create a new plugin as described, then in the module folder copied over the code from the core module, changed namespace, dirs and urls as described. But to no luck.

    Any advice are gratly appreciated

    #56849

    Johan
    Participant
    This reply has been marked as private.
    #56893

    Justin Busa
    Keymaster

    Hey Johan!

    I took a look and the first thing that stood out to me was these defines…

    define( 'CSM-dir', plugin_dir_path( __FILE__ ) );
    define( 'CSM-url', plugins_url( '/', __FILE__ ) );

    I believe dashes might not work in defines. Can you try underscores instead?

    Give that a shot and let me know how it goes.

    Justin

    #56908

    Johan
    Participant

    I just changed the defines to

    
    define( 'CSMdir', plugin_dir_path( __FILE__ ) );
    define( 'CSMurl', plugins_url( '/', __FILE__ ) );
    

    but no effect.

    could this, on line 75 has to do with it:

                    'file'          => FL_BUILDER_DIR  . 'includes/service-settings.php',
    
    #56933

    Justin Busa
    Keymaster

    Hey Johan,

    Yes, it looks like you have this…

    'file' => CSM-dir . 'includes/service-settings.php',

    it should be this…

    'file' => FL_BUILDER_DIR . 'includes/service-settings.php',

    Just a heads up, if you turn on WP_DEBUG, you should see errors regarding this stuff 🙂

    Justin

    #56966

    Johan
    Participant

    Ahh yes you didn’t download the updated code becuase I didn’t tell you I updated it, my bad!

    I changed it back to FL_BUILDER_DIR after the last edit. Also WP_DEBUG and WP_DEBUG_DISPLAY is on, no errors are shown 🙂

    #56990

    Justin Busa
    Keymaster

    No worries! Looks like it’s working now, just change…

    class cms extends FLBuilderModule {

    to…

    class CustomSubscribeModule extends FLBuilderModule {

    The class name needs to be the same as the one here…

    FLBuilder::register_module( 'CustomSubscribeModule', array(

    Let me know if there is anything else.

    Justin

    #57158

    Johan
    Participant

    Ahh yes, thanks you very much!

    #57379

    Justin Busa
    Keymaster

    You’re welcome, Johan!

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘Custom Module Development’ is closed to new topics and replies.