__( 'All Groups', 'a1-tools' ) ); if ( $saved_data ) { $groups_found = array(); foreach ( $saved_data as $cp ) { $gn = isset( $cp['group_name'] ) ? $cp['group_name'] : ''; if ( ! empty( $gn ) && ! in_array( $gn, $groups_found, true ) ) { $groups_found[] = $gn; $group_options[ $gn ] = $gn; } } sort( $groups_found ); } // ── Content Tab ───────────────────────────────────────────── $this->start_controls_section( 'content_section', array( 'label' => __( 'Content', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); // Info notice. if ( $count > 0 ) { $this->add_control( 'info_notice', array( 'type' => \Elementor\Controls_Manager::RAW_HTML, 'raw' => sprintf( /* translators: %d: number of city pages */ __( '%d city pages available. Assign groups in the A1 Tools app → Cities tab.', 'a1-tools' ), $count ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-success', ) ); } else { $this->add_control( 'info_notice', array( 'type' => \Elementor\Controls_Manager::RAW_HTML, 'raw' => __( 'No city pages configured. Add city data in the A1 Tools app → Cities tab.', 'a1-tools' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', ) ); } // Layout. $this->add_control( 'layout', array( 'label' => __( 'Layout', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'list', 'options' => array( 'list' => __( 'Single Column List', 'a1-tools' ), 'columns' => __( 'Multi-Column', 'a1-tools' ), ), ) ); // Columns count. $this->add_responsive_control( 'columns', array( 'label' => __( 'Columns', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 1, 'max' => 4, 'default' => 3, 'condition' => array( 'layout' => 'columns' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list' => 'columns: {{VALUE}};', ), ) ); // Show group headings. $this->add_control( 'show_groups', array( 'label' => __( 'Show Group Headings', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => 'yes', ) ); // Filter by group. $this->add_control( 'filter_group', array( 'label' => __( 'Filter by Group', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '', 'options' => $group_options, 'description' => __( 'Show only cities in a specific group.', 'a1-tools' ), ) ); // Filter by type. $this->add_control( 'filter_type', array( 'label' => __( 'Filter by Page Type', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'all', 'options' => array( 'all' => __( 'All Types', 'a1-tools' ), 'single_city' => __( 'Single City Only', 'a1-tools' ), 'location_city' => __( 'Location City Only', 'a1-tools' ), ), ) ); // Show bullets. $this->add_control( 'show_bullets', array( 'label' => __( 'Show Bullets', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => 'yes', ) ); // Link target. $this->add_control( 'link_target', array( 'label' => __( 'Link Target', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '_self', 'options' => array( '_self' => __( 'Same Window', 'a1-tools' ), '_blank' => __( 'New Tab', 'a1-tools' ), ), ) ); // Append state. $this->add_control( 'append_state', array( 'label' => __( 'Append State', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => '', 'description' => __( 'Add state abbreviation after city name (e.g., "Cherry Hill, NJ").', 'a1-tools' ), ) ); // State suffix text. $this->add_control( 'state_suffix', array( 'label' => __( 'State Suffix', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => '', 'placeholder' => __( 'NJ', 'a1-tools' ), 'condition' => array( 'append_state' => 'yes' ), ) ); // ── Accordion controls ────────────────────────────────────── $this->add_control( 'heading_accordion_options', array( 'label' => __( 'Accordion', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'show_groups' => 'yes' ), ) ); $this->add_control( 'enable_accordion', array( 'label' => __( 'Collapsible Groups', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => '', 'description' => __( 'Collapse city lists under clickable group headings.', 'a1-tools' ), 'condition' => array( 'show_groups' => 'yes' ), ) ); $this->add_control( 'accordion_default_state', array( 'label' => __( 'Default State', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'collapsed', 'options' => array( 'collapsed' => __( 'All Collapsed', 'a1-tools' ), 'expanded' => __( 'All Expanded', 'a1-tools' ), ), 'condition' => array( 'show_groups' => 'yes', 'enable_accordion' => 'yes', ), ) ); $this->add_control( 'accordion_mode', array( 'label' => __( 'Open Behavior', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'multiple', 'options' => array( 'multiple' => __( 'Allow Multiple Open', 'a1-tools' ), 'single' => __( 'One at a Time', 'a1-tools' ), ), 'condition' => array( 'show_groups' => 'yes', 'enable_accordion' => 'yes', ), ) ); $this->add_control( 'accordion_icon', array( 'label' => __( 'Show Arrow Indicator', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => 'yes', 'condition' => array( 'show_groups' => 'yes', 'enable_accordion' => 'yes', ), ) ); // ── City count + search controls ──────────────────────────── $this->add_control( 'heading_extras', array( 'label' => __( 'Extras', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_control( 'show_city_count', array( 'label' => __( 'Show City Count', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => '', 'description' => __( 'Display number of cities next to group heading.', 'a1-tools' ), 'condition' => array( 'show_groups' => 'yes' ), ) ); $this->add_control( 'show_search', array( 'label' => __( 'Show Search Bar', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => '', 'description' => __( 'Add a live-filter search box above the city list.', 'a1-tools' ), ) ); $this->add_control( 'search_placeholder', array( 'label' => __( 'Search Placeholder', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => 'Search cities...', 'condition' => array( 'show_search' => 'yes' ), ) ); $this->end_controls_section(); // ── Style: Container ──────────────────────────────────────── $this->start_controls_section( 'style_container_section', array( 'label' => __( 'Container', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ) ); $this->add_control( 'container_bg_color', array( 'label' => __( 'Background Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-list-wrapper' => 'background-color: {{VALUE}};', ), ) ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), array( 'name' => 'container_border', 'selector' => '{{WRAPPER}} .a1tools-city-list-wrapper', ) ); $this->add_control( 'container_border_radius', array( 'label' => __( 'Border Radius', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'container_padding', array( 'label' => __( 'Padding', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), array( 'name' => 'container_shadow', 'selector' => '{{WRAPPER}} .a1tools-city-list-wrapper', ) ); $this->end_controls_section(); // ── Style: Group Heading ──────────────────────────────────── $this->start_controls_section( 'style_group_heading_section', array( 'label' => __( 'Group Heading', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => array( 'show_groups' => 'yes' ), ) ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( 'name' => 'group_heading_typography', 'selector' => '{{WRAPPER}} .a1tools-city-group-heading', ) ); $this->add_control( 'group_heading_color', array( 'label' => __( 'Text Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-group-heading' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'group_heading_bg_color', array( 'label' => __( 'Background Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-group-heading' => 'background-color: {{VALUE}};', ), ) ); $this->add_responsive_control( 'group_heading_padding', array( 'label' => __( 'Padding', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-group-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'group_heading_spacing', array( 'label' => __( 'Spacing Below', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 40 ) ), 'default' => array( 'size' => 8, 'unit' => 'px' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-group-heading' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'group_spacing', array( 'label' => __( 'Group Spacing', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 60 ) ), 'default' => array( 'size' => 20, 'unit' => 'px' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-group' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), ) ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), array( 'name' => 'group_heading_border', 'selector' => '{{WRAPPER}} .a1tools-city-group-heading', ) ); $this->add_control( 'group_heading_border_radius', array( 'label' => __( 'Border Radius', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-group-heading' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); // City count color (inside Group Heading section). $this->add_control( 'city_count_color', array( 'label' => __( 'Count Badge Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-city-count' => 'color: {{VALUE}};', ), 'condition' => array( 'show_groups' => 'yes', 'show_city_count' => 'yes', ), ) ); $this->end_controls_section(); // ── Style: Accordion ──────────────────────────────────────── $this->start_controls_section( 'style_accordion_section', array( 'label' => __( 'Accordion', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => array( 'show_groups' => 'yes', 'enable_accordion' => 'yes', ), ) ); $this->add_control( 'accordion_icon_color', array( 'label' => __( 'Arrow Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-accordion-icon' => 'border-left-color: {{VALUE}};', ), 'condition' => array( 'accordion_icon' => 'yes' ), ) ); $this->add_responsive_control( 'accordion_icon_size', array( 'label' => __( 'Arrow Size', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 4, 'max' => 12 ) ), 'default' => array( 'size' => 6, 'unit' => 'px' ), 'selectors' => array( '{{WRAPPER}} .a1tools-accordion-icon' => 'border-left-width: {{SIZE}}{{UNIT}}; border-top-width: calc({{SIZE}}{{UNIT}} - 1px); border-bottom-width: calc({{SIZE}}{{UNIT}} - 1px);', ), 'condition' => array( 'accordion_icon' => 'yes' ), ) ); $this->add_responsive_control( 'accordion_animation_speed', array( 'label' => __( 'Animation Speed', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 500, 'step' => 50 ) ), 'default' => array( 'size' => 300, 'unit' => 'px' ), 'description' => __( 'Slide animation duration in milliseconds.', 'a1-tools' ), ) ); $this->end_controls_section(); // ── Style: Search Bar ─────────────────────────────────────── $this->start_controls_section( 'style_search_section', array( 'label' => __( 'Search Bar', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => array( 'show_search' => 'yes' ), ) ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( 'name' => 'search_typography', 'selector' => '{{WRAPPER}} .a1tools-city-search-input', ) ); $this->add_control( 'search_text_color', array( 'label' => __( 'Text Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-search-input' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'search_placeholder_color', array( 'label' => __( 'Placeholder Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-search-input::placeholder' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'search_bg_color', array( 'label' => __( 'Background Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-search-input' => 'background-color: {{VALUE}};', ), ) ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), array( 'name' => 'search_border', 'selector' => '{{WRAPPER}} .a1tools-city-search-input', ) ); $this->add_control( 'search_border_radius', array( 'label' => __( 'Border Radius', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-search-input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'search_padding', array( 'label' => __( 'Padding', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-search-input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'search_spacing', array( 'label' => __( 'Spacing Below', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 40 ) ), 'default' => array( 'size' => 16, 'unit' => 'px' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-search-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_section(); // ── Style: List Items ─────────────────────────────────────── $this->start_controls_section( 'style_list_items_section', array( 'label' => __( 'List Items', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ) ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( 'name' => 'item_typography', 'selector' => '{{WRAPPER}} .a1tools-city-list li a', ) ); // Normal/Hover tabs. $this->start_controls_tabs( 'item_style_tabs' ); $this->start_controls_tab( 'item_normal_tab', array( 'label' => __( 'Normal', 'a1-tools' ) ) ); $this->add_control( 'item_text_color', array( 'label' => __( 'Text Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-list li a' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'item_decoration', array( 'label' => __( 'Link Decoration', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'none', 'options' => array( 'none' => __( 'None', 'a1-tools' ), 'underline' => __( 'Underline', 'a1-tools' ), ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list li a' => 'text-decoration: {{VALUE}};', ), ) ); $this->end_controls_tab(); $this->start_controls_tab( 'item_hover_tab', array( 'label' => __( 'Hover', 'a1-tools' ) ) ); $this->add_control( 'item_hover_color', array( 'label' => __( 'Text Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-city-list li a:hover' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'item_hover_decoration', array( 'label' => __( 'Link Decoration', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'underline', 'options' => array( 'none' => __( 'None', 'a1-tools' ), 'underline' => __( 'Underline', 'a1-tools' ), ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list li a:hover' => 'text-decoration: {{VALUE}};', ), ) ); $this->end_controls_tab(); $this->end_controls_tabs(); // Bullet styling. $this->add_control( 'bullet_color', array( 'label' => __( 'Bullet Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-city-list li::marker' => 'color: {{VALUE}};', ), ) ); // Item spacing. $this->add_responsive_control( 'item_spacing', array( 'label' => __( 'Item Spacing', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 30 ) ), 'default' => array( 'size' => 6, 'unit' => 'px' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list li' => 'margin-bottom: {{SIZE}}{{UNIT}};', ), ) ); // Item padding. $this->add_responsive_control( 'item_padding', array( 'label' => __( 'Item Padding', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); // ── Style: Column Layout ──────────────────────────────────── $this->start_controls_section( 'style_columns_section', array( 'label' => __( 'Column Layout', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => array( 'layout' => 'columns' ), ) ); $this->add_responsive_control( 'column_gap', array( 'label' => __( 'Column Gap', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 60 ) ), 'default' => array( 'size' => 20, 'unit' => 'px' ), 'selectors' => array( '{{WRAPPER}} .a1tools-city-list' => 'column-gap: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_section(); } /** * Render widget output on the frontend. */ protected function render() { $settings = $this->get_settings_for_display(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped inside shortcode function. echo a1tools_shortcode_city_list( array( 'layout' => $settings['layout'] ?? 'list', 'columns' => $settings['columns'] ?? '3', 'show_groups' => $settings['show_groups'] ?? 'yes', 'group' => $settings['filter_group'] ?? '', 'type' => $settings['filter_type'] ?? 'all', 'show_bullets' => $settings['show_bullets'] ?? '', 'target' => $settings['link_target'] ?? '_self', 'append_state' => $settings['append_state'] ?? '', 'state' => $settings['state_suffix'] ?? '', 'accordion' => $settings['enable_accordion'] ?? '', 'accordion_default' => $settings['accordion_default_state'] ?? 'collapsed', 'accordion_mode' => $settings['accordion_mode'] ?? 'multiple', 'accordion_icon' => $settings['accordion_icon'] ?? 'yes', 'accordion_speed' => isset( $settings['accordion_animation_speed']['size'] ) ? $settings['accordion_animation_speed']['size'] : '300', 'show_count' => $settings['show_city_count'] ?? '', 'show_search' => $settings['show_search'] ?? '', 'search_placeholder' => $settings['search_placeholder'] ?? '', '_elementor' => 'yes', ) ); } /** * Render widget preview in the Elementor editor. */ protected function content_template() { ?> <# var isAccordion = (settings.show_groups === 'yes' && settings.enable_accordion === 'yes'); var isExpanded = (settings.accordion_default_state !== 'collapsed'); var showIcon = (isAccordion && settings.accordion_icon === 'yes'); var showCount = (settings.show_groups === 'yes' && settings.show_city_count === 'yes'); var showSearch = (settings.show_search === 'yes'); var stateSuffix = (settings.append_state === 'yes' && settings.state_suffix) ? ', ' + settings.state_suffix : ''; var listStyle = (settings.show_bullets !== 'yes') ? 'style="list-style:none;padding-left:0;"' : ''; #>
<# if ( showSearch ) { #>
<# } #> <# if ( settings.show_groups === 'yes' ) { #> <# var groups = [ { name: 'Camden County', cities: ['Cherry Hill','Haddonfield','Voorhees'] }, { name: 'Ocean County', cities: ['Toms River','Lakewood'] } ]; #> <# _.each( groups, function( group ) { #>

role="button" aria-expanded="{{ isExpanded ? 'true' : 'false' }}"<#}#>> <# if(showIcon){#><#}#> {{ group.name }} <# if(showCount){#> ({{ group.cities.length }})<#}#>

<# if(isAccordion){#>
style="display:none;"<#}#>> <#}#> <# if(isAccordion){#>
<#}#>
<# }); #> <# } else { #> <# } #>
Note: Actual city pages with links load on the frontend from the A1 Tools API. <# if(isAccordion){#>
Accordion expand/collapse is active on the frontend.<#}#> <# if(showSearch){#>
Search filtering is active on the frontend.<#}#>