Suggest_field not working with custom taxonomy

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 / Suggest_field not working with custom taxonomy

This topic is: not resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #97836

    Dainis
    Participant

    Hey guys,

    I have a custom taxonomy (videos), and suggest_field using fl_as_terms isn’t working.

    Here is my code:

    FLBuilder::register_module('ShowCat', array(
        'general'       => array( // Tab
            'title'         => __('General', 'fl-builder'), // Tab title
            'sections'      => array( // Tab Sections
                'general'       => array( // Section
                    'title'         => __('Settings', 'fl-builder'), // Section Title
                    'fields'        => array( // Section Fields
    
                        'suggest_field'  => array(
                            'type'          => 'suggest',
                            'label'         => __('Find Video', 'fl-builder'),
                            'action'        => 'fl_as_terms',
                            'data'          => 'videos'
                        ),
                        
                        'select_field2'   => array(
                            'type'          => 'select',
                            'label'         => __('Which Category is this in?', 'fl-builder'),
                            'default'       => 'residential',
                            'options'       => array(
                                'residential'      => __('Residential', 'fl-builder'),
                                'commercial'      => __('Commercial', 'fl-builder'),
                                'finance-101'      => __('Finance 101', 'fl-builder'),
                                'hear-from-the-experts'      => __('Hear From The Experts', 'fl-builder'),
                                'in-the-news'      => __('In The News', 'fl-builder'),
                                'our-team'      => __('Our Team', 'fl-builder'),
                            )
                        ),
                    )
                )
            )
        )
    ));
    #97893

    Ben Carlo
    Keymaster

    Hey Dainis,

    I’ve already assigned another member of the team to assist you with your concern. 🙂

    Ben

    #98215

    Justin Busa
    Keymaster

    Hey Dainis,

    The code looks correct, so there may be an issue somewhere else. Here are a few things to check…

    – Do you have a taxonomy called “videos” setup on your site using register_taxonomy?

    – Is the taxonomy slug “videos” or is it possible something else (like video)? The data attribute needs to be the term’s slug.

    Have a look at those and let me know what you find.

    Justin

    #105336

    Philip
    Participant

    Also be sure that the register_taxonomy function is hooked to the init action at a lower priority than the init function that registers your custom module.

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

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