| 1 |
<?php |
| 2 |
namespace WPDeveloper\BetterDocs\Editors\Elementor\Widget; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly |
| 6 |
} |
| 7 |
|
| 8 |
use Elementor\Controls_Manager; |
| 9 |
use Elementor\Group_Control_Background; |
| 10 |
use Elementor\Group_Control_Typography; |
| 11 |
use WPDeveloper\BetterDocs\Editors\Elementor\BaseWidget; |
| 12 |
use Elementor\Group_Control_Border as Group_Control_Border; |
| 13 |
use Elementor\Group_Control_Box_Shadow as Group_Control_Box_Shadow; |
| 14 |
use Elementor\Plugin; |
| 15 |
|
| 16 |
class Sidebar extends BaseWidget { |
| 17 |
|
| 18 |
public function get_name() { |
| 19 |
return 'betterdocs-sidebar'; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_title() { |
| 23 |
return __( 'Doc Sidebar', 'betterdocs' ); |
| 24 |
} |
| 25 |
|
| 26 |
public function get_icon() { |
| 27 |
return 'betterdocs-icon-Sidebar'; |
| 28 |
} |
| 29 |
|
| 30 |
public function get_categories() { |
| 31 |
return ['betterdocs-elements', 'docs-archive']; |
| 32 |
} |
| 33 |
|
| 34 |
public function get_keywords() { |
| 35 |
return ['betterdocs-elements', 'sidebar', 'betterdocs', 'docs']; |
| 36 |
} |
| 37 |
|
| 38 |
public function get_style_depends() { |
| 39 |
return ['betterdocs-sidebar']; |
| 40 |
} |
| 41 |
|
| 42 |
public function get_script_depends() { |
| 43 |
return ['betterdocs-category-grid']; |
| 44 |
} |
| 45 |
|
| 46 |
public function get_custom_help_url() { |
| 47 |
return 'https://betterdocs.co/docs/single-doc-in-elementor'; |
| 48 |
} |
| 49 |
|
| 50 |
protected function register_controls() { |
| 51 |
/** |
| 52 |
* Query Controls! |
| 53 |
* @source BaseWidget |
| 54 |
*/ |
| 55 |
$this->betterdocs_do_action(); |
| 56 |
|
| 57 |
do_action( 'betterdocs_elementor_sidebar_layout_select', $this ); |
| 58 |
|
| 59 |
$this->sidebar_layout_select(); |
| 60 |
|
| 61 |
if ( ! is_plugin_active( 'betterdocs-pro/betterdocs-pro.php' ) ) { |
| 62 |
$this->start_controls_section( |
| 63 |
'betterdocs_section_pro', |
| 64 |
[ |
| 65 |
'label' => __( 'Go Premium for More Features', 'betterdocs' ) |
| 66 |
] |
| 67 |
); |
| 68 |
|
| 69 |
$this->add_control( |
| 70 |
'betterdocs_control_get_pro', |
| 71 |
[ |
| 72 |
'label' => __( 'Unlock more possibilities', 'betterdocs' ), |
| 73 |
'type' => Controls_Manager::CHOOSE, |
| 74 |
'options' => [ |
| 75 |
'1' => [ |
| 76 |
'title' => '', |
| 77 |
'icon' => 'fa fa-unlock-alt' |
| 78 |
] |
| 79 |
], |
| 80 |
'default' => '1', |
| 81 |
'description' => '<span class="pro-feature"> Get the <a href="https://betterdocs.co/upgrade" target="_blank">Pro version</a> for more stunning layouts and customization options.</span>' |
| 82 |
] |
| 83 |
); |
| 84 |
|
| 85 |
$this->end_controls_section(); |
| 86 |
} |
| 87 |
|
| 88 |
$this->wraper_setting_style(); |
| 89 |
|
| 90 |
$this->category_items_setting_style(); |
| 91 |
|
| 92 |
$this->icon_style(); |
| 93 |
|
| 94 |
$this->title_style(); |
| 95 |
|
| 96 |
$this->count_style(); |
| 97 |
|
| 98 |
$this->list_setting(); |
| 99 |
|
| 100 |
$this->sub_list_setting(); |
| 101 |
|
| 102 |
$this->sticky_toc(); |
| 103 |
} |
| 104 |
|
| 105 |
public function sidebar_layout_select() { |
| 106 |
/** |
| 107 |
* ---------------------------------------------------------- |
| 108 |
* Section: Select Layout |
| 109 |
* ---------------------------------------------------------- |
| 110 |
*/ |
| 111 |
$this->start_controls_section( |
| 112 |
'section_layout_settings', |
| 113 |
[ |
| 114 |
'label' => __( 'Layout', 'betterdocs' ) |
| 115 |
] |
| 116 |
); |
| 117 |
|
| 118 |
$this->add_control( |
| 119 |
'betterdocs_sidebar_layout', |
| 120 |
[ |
| 121 |
'label' => esc_html__( 'Select layout', 'betterdocs' ), |
| 122 |
'type' => Controls_Manager::SELECT, |
| 123 |
'default' => 'layout-1', |
| 124 |
'label_block' => false, |
| 125 |
'options' => [ |
| 126 |
'layout-1' => esc_html__( 'Layout 1', 'betterdocs' ), |
| 127 |
'layout-2' => esc_html__( 'Layout 2', 'betterdocs' ), |
| 128 |
'layout-3' => esc_html__( 'Layout 3', 'betterdocs' ), |
| 129 |
'layout-4' => esc_html__( 'Layout 4', 'betterdocs' ) |
| 130 |
] |
| 131 |
] |
| 132 |
); |
| 133 |
|
| 134 |
if ( ! is_plugin_active( 'betterdocs-pro/betterdocs-pro.php' ) ) { |
| 135 |
$this->add_control( |
| 136 |
'betterdocs_sidebar_layout_warning_text', |
| 137 |
[ |
| 138 |
'type' => Controls_Manager::RAW_HTML, |
| 139 |
'raw' => __( 'This layout is available in pro version only!', 'betterdocs' ), |
| 140 |
'content_classes' => 'betterdocs-ea-warning', |
| 141 |
'condition' => [ |
| 142 |
'betterdocs_sidebar_layout' => ['layout-2', 'layout-3'] |
| 143 |
] |
| 144 |
] |
| 145 |
); |
| 146 |
} |
| 147 |
|
| 148 |
$this->add_control( |
| 149 |
'category_title_tag', |
| 150 |
[ |
| 151 |
'label' => __( 'Category Title Tag', 'betterdocs' ), |
| 152 |
'type' => Controls_Manager::SELECT, |
| 153 |
'default' => 'h2', |
| 154 |
'options' => [ |
| 155 |
'h1' => __( 'H1', 'betterdocs' ), |
| 156 |
'h2' => __( 'H2', 'betterdocs' ), |
| 157 |
'h3' => __( 'H3', 'betterdocs' ), |
| 158 |
'h4' => __( 'H4', 'betterdocs' ), |
| 159 |
'h5' => __( 'H5', 'betterdocs' ), |
| 160 |
'h6' => __( 'H6', 'betterdocs' ) |
| 161 |
] |
| 162 |
] |
| 163 |
); |
| 164 |
|
| 165 |
$this->add_control( |
| 166 |
'show_icon', |
| 167 |
[ |
| 168 |
'label' => __( 'Show Icon', 'betterdocs' ), |
| 169 |
'type' => Controls_Manager::SWITCHER, |
| 170 |
'label_on' => __( 'Show', 'betterdocs' ), |
| 171 |
'label_off' => __( 'Hide', 'betterdocs' ), |
| 172 |
'return_value' => 'true', |
| 173 |
'default' => 'true', |
| 174 |
'condition' => [ |
| 175 |
'betterdocs_sidebar_layout' => ['layout-1'] |
| 176 |
] |
| 177 |
] |
| 178 |
); |
| 179 |
|
| 180 |
$this->add_control( |
| 181 |
'show_count', |
| 182 |
[ |
| 183 |
'label' => __( 'Show Count', 'betterdocs' ), |
| 184 |
'type' => Controls_Manager::SWITCHER, |
| 185 |
'label_on' => __( 'Show', 'betterdocs' ), |
| 186 |
'label_off' => __( 'Hide', 'betterdocs' ), |
| 187 |
'return_value' => 'true', |
| 188 |
'default' => 'true', |
| 189 |
'condition' => [ |
| 190 |
'betterdocs_sidebar_layout' => ['layout-1'] |
| 191 |
] |
| 192 |
] |
| 193 |
); |
| 194 |
|
| 195 |
$this->end_controls_section(); # end of 'Select Layout' |
| 196 |
} |
| 197 |
|
| 198 |
public function sticky_toc() { |
| 199 |
/** |
| 200 |
* ---------------------------------------------------------- |
| 201 |
* Section: Box Styles |
| 202 |
* ---------------------------------------------------------- |
| 203 |
*/ |
| 204 |
$this->start_controls_section( |
| 205 |
'section_sticky_toc', |
| 206 |
[ |
| 207 |
'label' => __( 'Sticky TOC', 'betterdocs' ), |
| 208 |
'tab' => Controls_Manager::TAB_STYLE |
| 209 |
] |
| 210 |
); |
| 211 |
|
| 212 |
$this->add_control( |
| 213 |
'enable_sticky_toc', |
| 214 |
[ |
| 215 |
'label' => __( 'Enable Sticky TOC', 'betterdocs' ), |
| 216 |
'type' => Controls_Manager::SWITCHER, |
| 217 |
'label_on' => __( 'Show', 'betterdocs' ), |
| 218 |
'label_off' => __( 'Hide', 'betterdocs' ), |
| 219 |
'return_value' => '1', |
| 220 |
'default' => '' |
| 221 |
] |
| 222 |
); |
| 223 |
|
| 224 |
$this->add_responsive_control( |
| 225 |
'toc_width', |
| 226 |
[ |
| 227 |
'label' => __( 'TOC Width', 'betterdocs' ), |
| 228 |
'type' => Controls_Manager::SLIDER, |
| 229 |
'size_units' => ['px', '%', 'em'], |
| 230 |
'range' => [ |
| 231 |
'px' => [ |
| 232 |
'max' => 1000, |
| 233 |
'step' => 1 |
| 234 |
], |
| 235 |
'%' => [ |
| 236 |
'max' => 100, |
| 237 |
'step' => 1 |
| 238 |
] |
| 239 |
], |
| 240 |
'selectors' => [ |
| 241 |
'{{WRAPPER}} .sticky-toc-container' => 'width: {{SIZE}}{{UNIT}};' |
| 242 |
] |
| 243 |
] |
| 244 |
); |
| 245 |
|
| 246 |
$this->add_responsive_control( |
| 247 |
'toc_zindex', // Legacy control id but new control |
| 248 |
[ |
| 249 |
'label' => __( 'Z index', 'betterdocs' ), |
| 250 |
'type' => Controls_Manager::NUMBER, |
| 251 |
'min' => 0, |
| 252 |
'max' => 1000, |
| 253 |
'step' => 5, |
| 254 |
'default' => 320, |
| 255 |
'selectors' => [ |
| 256 |
'{{WRAPPER}} .sticky-toc-container' => 'z-index: {{VALUE}}%;' |
| 257 |
] |
| 258 |
] |
| 259 |
); |
| 260 |
|
| 261 |
$this->end_controls_section(); # end of 'Card Settings' |
| 262 |
} |
| 263 |
|
| 264 |
public function wraper_setting_style() { |
| 265 |
$this->start_controls_section( |
| 266 |
'section_card_settings', |
| 267 |
[ |
| 268 |
'label' => __( 'Wraper', 'betterdocs' ), |
| 269 |
'tab' => Controls_Manager::TAB_STYLE |
| 270 |
] |
| 271 |
); |
| 272 |
|
| 273 |
$this->add_responsive_control( |
| 274 |
'column_space', // Legacy control id but new control |
| 275 |
[ |
| 276 |
'label' => __( 'Margin', 'betterdocs' ), |
| 277 |
'type' => Controls_Manager::DIMENSIONS, |
| 278 |
'size_units' => ['px', '%', 'em'], |
| 279 |
'selectors' => [ |
| 280 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 281 |
] |
| 282 |
] |
| 283 |
); |
| 284 |
|
| 285 |
$this->add_responsive_control( |
| 286 |
'column_padding', |
| 287 |
[ |
| 288 |
'label' => __( 'Padding', 'betterdocs' ), |
| 289 |
'type' => Controls_Manager::DIMENSIONS, |
| 290 |
'size_units' => ['px', 'em', '%'], |
| 291 |
'selectors' => [ |
| 292 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 293 |
] |
| 294 |
] |
| 295 |
); |
| 296 |
$this->add_control( |
| 297 |
'column_height', |
| 298 |
[ |
| 299 |
'label' => __( 'Height', 'plugin-domain' ), |
| 300 |
'type' => Controls_Manager::SLIDER, |
| 301 |
'size_units' => ['px', '%'], |
| 302 |
'range' => [ |
| 303 |
'px' => [ |
| 304 |
'min' => 0, |
| 305 |
'max' => 1000, |
| 306 |
'step' => 5 |
| 307 |
], |
| 308 |
'%' => [ |
| 309 |
'min' => 0, |
| 310 |
'max' => 100 |
| 311 |
] |
| 312 |
], |
| 313 |
'selectors' => [ |
| 314 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper' => 'height: {{SIZE}}{{UNIT}};' |
| 315 |
] |
| 316 |
] |
| 317 |
); |
| 318 |
|
| 319 |
$this->add_responsive_control( |
| 320 |
'box_seperator_color', |
| 321 |
[ |
| 322 |
'label' => esc_html__( 'Background Color', 'betterdocs' ), |
| 323 |
'type' => Controls_Manager::COLOR, |
| 324 |
'selectors' => [ |
| 325 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper' => 'background-color: {{VALUE}};' |
| 326 |
] |
| 327 |
] |
| 328 |
); |
| 329 |
$this->end_controls_section(); # end of 'Card Settings' |
| 330 |
} |
| 331 |
|
| 332 |
public function category_items_setting_style() { |
| 333 |
$this->start_controls_section( |
| 334 |
'category_items_settings', |
| 335 |
[ |
| 336 |
'label' => __( 'Category Items', 'betterdocs' ), |
| 337 |
'tab' => Controls_Manager::TAB_STYLE |
| 338 |
] |
| 339 |
); |
| 340 |
$this->start_controls_tabs( 'category_items_settings_tabs' ); |
| 341 |
|
| 342 |
// Normal State Tab |
| 343 |
$this->start_controls_tab( |
| 344 |
'card_normal', |
| 345 |
['label' => esc_html__( 'Normal', 'betterdocs' )] |
| 346 |
); |
| 347 |
|
| 348 |
|
| 349 |
$this->add_group_control( |
| 350 |
Group_Control_Background::get_type(), |
| 351 |
[ |
| 352 |
'name' => 'card_bg_normal', |
| 353 |
'types' => ['classic', 'gradient'], |
| 354 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body, {{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body' |
| 355 |
] |
| 356 |
); |
| 357 |
|
| 358 |
$this->add_group_control( |
| 359 |
Group_Control_Border::get_type(), |
| 360 |
[ |
| 361 |
'name' => 'card_border_normal', |
| 362 |
'label' => esc_html__( 'Border', 'betterdocs' ), |
| 363 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body, {{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body' |
| 364 |
] |
| 365 |
); |
| 366 |
|
| 367 |
$this->add_responsive_control( |
| 368 |
'card_border_radius_normal', |
| 369 |
[ |
| 370 |
'label' => esc_html__( 'Border Radius', 'betterdocs' ), |
| 371 |
'type' => Controls_Manager::DIMENSIONS, |
| 372 |
'size_units' => ['px', 'em', '%'], |
| 373 |
'selectors' => [ |
| 374 |
'{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 375 |
'{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 376 |
] |
| 377 |
] |
| 378 |
); |
| 379 |
|
| 380 |
$this->add_group_control( |
| 381 |
Group_Control_Box_Shadow::get_type(), |
| 382 |
[ |
| 383 |
'name' => 'card_box_shadow_normal', |
| 384 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body, {{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body' |
| 385 |
] |
| 386 |
); |
| 387 |
|
| 388 |
$this->end_controls_tab(); |
| 389 |
|
| 390 |
// Hover State Tab |
| 391 |
$this->start_controls_tab( |
| 392 |
'card_hover', |
| 393 |
['label' => esc_html__( 'Hover', 'betterdocs' )] |
| 394 |
); |
| 395 |
|
| 396 |
$this->add_control( |
| 397 |
'card_transition', |
| 398 |
[ |
| 399 |
'label' => __( 'Transition', 'betterdocs' ), |
| 400 |
'type' => Controls_Manager::SLIDER, |
| 401 |
'default' => [ |
| 402 |
'size' => 300, |
| 403 |
'unit' => '%' |
| 404 |
], |
| 405 |
'size_units' => ['%'], |
| 406 |
'range' => [ |
| 407 |
'%' => [ |
| 408 |
'max' => 2500, |
| 409 |
'step' => 1 |
| 410 |
] |
| 411 |
], |
| 412 |
'selectors' => [ |
| 413 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .docs-single-cat-wrap' => 'transition: {{SIZE}}ms;' |
| 414 |
] |
| 415 |
] |
| 416 |
); |
| 417 |
|
| 418 |
|
| 419 |
$this->add_control( |
| 420 |
'box_section_body_hover', |
| 421 |
[ |
| 422 |
'label' => __( 'Body', 'betterdocs' ), |
| 423 |
'type' => Controls_Manager::HEADING, |
| 424 |
'separator' => 'before' |
| 425 |
] |
| 426 |
); |
| 427 |
|
| 428 |
$this->add_group_control( |
| 429 |
Group_Control_Background::get_type(), |
| 430 |
[ |
| 431 |
'name' => 'card_bg_hover', |
| 432 |
'types' => ['classic', 'gradient'], |
| 433 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body:hover, {{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body:hover' |
| 434 |
] |
| 435 |
); |
| 436 |
|
| 437 |
$this->add_group_control( |
| 438 |
Group_Control_Border::get_type(), |
| 439 |
[ |
| 440 |
'name' => 'card_border_hover', |
| 441 |
'label' => esc_html__( 'Border', 'betterdocs' ), |
| 442 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body:hover, {{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body:hover' |
| 443 |
] |
| 444 |
); |
| 445 |
|
| 446 |
$this->add_responsive_control( |
| 447 |
'card_border_radius_hover', |
| 448 |
[ |
| 449 |
'label' => esc_html__( 'Border Radius', 'betterdocs' ), |
| 450 |
'type' => Controls_Manager::DIMENSIONS, |
| 451 |
'size_units' => ['px', 'em', '%'], |
| 452 |
'selectors' => [ |
| 453 |
'{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 454 |
'{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 455 |
] |
| 456 |
] |
| 457 |
); |
| 458 |
|
| 459 |
$this->add_group_control( |
| 460 |
Group_Control_Box_Shadow::get_type(), |
| 461 |
[ |
| 462 |
'name' => 'card_box_shadow_hover', |
| 463 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body:hover, {{WRAPPER}} .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-single-category-inner .betterdocs-body:hover' |
| 464 |
] |
| 465 |
); |
| 466 |
|
| 467 |
|
| 468 |
$this->end_controls_tabs(); |
| 469 |
$this->end_controls_section(); # end of 'Card Settings' |
| 470 |
} |
| 471 |
|
| 472 |
public function icon_style() { |
| 473 |
/** |
| 474 |
* ---------------------------------------------------------- |
| 475 |
* Section: Icon Styles |
| 476 |
* ---------------------------------------------------------- |
| 477 |
*/ |
| 478 |
$this->start_controls_section( |
| 479 |
'section_box_icon_style', |
| 480 |
[ |
| 481 |
'label' => __( 'Icon', 'betterdocs' ), |
| 482 |
'tab' => Controls_Manager::TAB_STYLE |
| 483 |
] |
| 484 |
); |
| 485 |
|
| 486 |
$this->add_responsive_control( |
| 487 |
'category_settings_icon_size_normal', |
| 488 |
[ |
| 489 |
'label' => esc_html__( 'Size', 'betterdocs' ), |
| 490 |
'type' => Controls_Manager::SLIDER, |
| 491 |
'size_units' => ['px', '%', 'em'], |
| 492 |
'range' => [ |
| 493 |
'px' => [ |
| 494 |
'max' => 500 |
| 495 |
] |
| 496 |
], |
| 497 |
'selectors' => [ |
| 498 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper:not(.layout-2) .betterdocs-category-icon' => 'height: {{SIZE}}{{UNIT}}; width: auto;', |
| 499 |
'{{WRAPPER}} .betterdocs-category-icon img' => 'height: {{SIZE}}{{UNIT}};' |
| 500 |
] |
| 501 |
] |
| 502 |
); |
| 503 |
|
| 504 |
$this->add_responsive_control( |
| 505 |
'category_settings_arrow_width_normal', |
| 506 |
[ |
| 507 |
'label' => esc_html__( 'Arrow Width', 'betterdocs' ), |
| 508 |
'type' => Controls_Manager::SLIDER, |
| 509 |
'size_units' => ['px', '%', 'em'], |
| 510 |
'range' => [ |
| 511 |
'px' => [ |
| 512 |
'max' => 500 |
| 513 |
] |
| 514 |
], |
| 515 |
'selectors' => [ |
| 516 |
'{{WRAPPER}} .betterdocs-category-collapse' => 'width: {{SIZE}}{{UNIT}};' |
| 517 |
], |
| 518 |
'condition' => [ |
| 519 |
'betterdocs_sidebar_layout' => ['layout-4'] |
| 520 |
] |
| 521 |
] |
| 522 |
); |
| 523 |
|
| 524 |
$this->add_responsive_control( |
| 525 |
'category_settings_arrow_height_normal', |
| 526 |
[ |
| 527 |
'label' => esc_html__( 'Arrow Height', 'betterdocs' ), |
| 528 |
'type' => Controls_Manager::SLIDER, |
| 529 |
'size_units' => ['px', '%', 'em'], |
| 530 |
'range' => [ |
| 531 |
'px' => [ |
| 532 |
'max' => 500 |
| 533 |
] |
| 534 |
], |
| 535 |
'selectors' => [ |
| 536 |
'{{WRAPPER}} .betterdocs-category-collapse' => 'height: {{SIZE}}{{UNIT}};' |
| 537 |
], |
| 538 |
'condition' => [ |
| 539 |
'betterdocs_sidebar_layout' => ['layout-4'] |
| 540 |
] |
| 541 |
] |
| 542 |
); |
| 543 |
|
| 544 |
$this->start_controls_tabs( 'box_icon_styles_tab' ); |
| 545 |
|
| 546 |
// Normal State Tab |
| 547 |
$this->start_controls_tab( |
| 548 |
'icon_normal', |
| 549 |
['label' => esc_html__( 'Normal', 'betterdocs' )] |
| 550 |
); |
| 551 |
|
| 552 |
$this->add_control( |
| 553 |
'arrow_color', |
| 554 |
[ |
| 555 |
'label' => __( 'Arrow Color', 'plugin-domain' ), |
| 556 |
'type' => Controls_Manager::COLOR, |
| 557 |
'selectors' => [ |
| 558 |
'{{WRAPPER}} .betterdocs-category-collapse' => 'color: {{VALUE}}' |
| 559 |
], |
| 560 |
'condition' => [ |
| 561 |
'betterdocs_sidebar_layout' => ['layout-4'] |
| 562 |
] |
| 563 |
] |
| 564 |
); |
| 565 |
|
| 566 |
$this->add_group_control( |
| 567 |
Group_Control_Background::get_type(), |
| 568 |
[ |
| 569 |
'name' => 'icon_background_normal', |
| 570 |
'types' => ['classic', 'gradient'], |
| 571 |
'selector' => '{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-icon', |
| 572 |
'exclude' => [ |
| 573 |
'image' |
| 574 |
] |
| 575 |
] |
| 576 |
); |
| 577 |
|
| 578 |
$this->add_group_control( |
| 579 |
Group_Control_Border::get_type(), |
| 580 |
[ |
| 581 |
'name' => 'icon_border_normal', |
| 582 |
'label' => esc_html__( 'Border', 'betterdocs' ), |
| 583 |
'selector' => '{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-icon' |
| 584 |
] |
| 585 |
); |
| 586 |
|
| 587 |
$this->add_responsive_control( |
| 588 |
'icon_border_radius_normal', |
| 589 |
[ |
| 590 |
'label' => esc_html__( 'Border Radius', 'betterdocs' ), |
| 591 |
'type' => Controls_Manager::DIMENSIONS, |
| 592 |
'size_units' => ['px', 'em', '%'], |
| 593 |
'selectors' => [ |
| 594 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 595 |
] |
| 596 |
] |
| 597 |
); |
| 598 |
|
| 599 |
$this->add_responsive_control( |
| 600 |
'icon_padding', |
| 601 |
[ |
| 602 |
'label' => esc_html__( 'Padding', 'betterdocs' ), |
| 603 |
'type' => Controls_Manager::DIMENSIONS, |
| 604 |
'size_units' => ['px', 'em', '%'], |
| 605 |
'selectors' => [ |
| 606 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 607 |
] |
| 608 |
] |
| 609 |
); |
| 610 |
|
| 611 |
$this->add_responsive_control( |
| 612 |
'icon_spacing', |
| 613 |
[ |
| 614 |
'label' => esc_html__( 'Spacing', 'betterdocs' ), |
| 615 |
'type' => Controls_Manager::DIMENSIONS, |
| 616 |
'size_units' => ['px', 'em', '%'], |
| 617 |
'allowed_dimensions' => [ |
| 618 |
'top', |
| 619 |
'bottom' |
| 620 |
], |
| 621 |
'selectors' => [ |
| 622 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-icon' => 'margin: {{TOP}}{{UNIT}} auto {{BOTTOM}}{{UNIT}} auto;' |
| 623 |
] |
| 624 |
] |
| 625 |
); |
| 626 |
|
| 627 |
$this->add_responsive_control( |
| 628 |
'arrow_padding_normal', |
| 629 |
[ |
| 630 |
'label' => esc_html__( 'Arrow Padding', 'betterdocs' ), |
| 631 |
'type' => Controls_Manager::DIMENSIONS, |
| 632 |
'size_units' => ['px', 'em', '%'], |
| 633 |
'selectors' => [ |
| 634 |
'{{WRAPPER}} .betterdocs-category-collapse' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 635 |
], |
| 636 |
'condition' => [ |
| 637 |
'betterdocs_sidebar_layout' => ['layout-4'] |
| 638 |
] |
| 639 |
] |
| 640 |
); |
| 641 |
|
| 642 |
$this->add_responsive_control( |
| 643 |
'arrow_margin_normal', |
| 644 |
[ |
| 645 |
'label' => esc_html__( 'Arrow Margin', 'betterdocs' ), |
| 646 |
'type' => Controls_Manager::DIMENSIONS, |
| 647 |
'size_units' => ['px', 'em', '%'], |
| 648 |
'selectors' => [ |
| 649 |
'{{WRAPPER}} .betterdocs-category-collapse' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 650 |
], |
| 651 |
'condition' => [ |
| 652 |
'betterdocs_sidebar_layout' => ['layout-4'] |
| 653 |
] |
| 654 |
] |
| 655 |
); |
| 656 |
|
| 657 |
$this->end_controls_tab(); |
| 658 |
|
| 659 |
// Hover State Tab |
| 660 |
$this->start_controls_tab( |
| 661 |
'icon_hover', |
| 662 |
['label' => esc_html__( 'Hover', 'betterdocs' )] |
| 663 |
); |
| 664 |
|
| 665 |
$this->add_control( |
| 666 |
'arrow_color_hover', |
| 667 |
[ |
| 668 |
'label' => __( 'Arrow Color', 'plugin-domain' ), |
| 669 |
'type' => Controls_Manager::COLOR, |
| 670 |
'selectors' => [ |
| 671 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-header:hover .betterdocs-category-arrow' => 'color: {{VALUE}}' |
| 672 |
] |
| 673 |
] |
| 674 |
); |
| 675 |
|
| 676 |
$this->add_group_control( |
| 677 |
Group_Control_Background::get_type(), |
| 678 |
[ |
| 679 |
'name' => 'icon_background_hover', |
| 680 |
'types' => ['classic', 'gradient'], |
| 681 |
'selector' => '{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-header:hover .betterdocs-category-icon' |
| 682 |
] |
| 683 |
); |
| 684 |
|
| 685 |
$this->add_group_control( |
| 686 |
Group_Control_Border::get_type(), |
| 687 |
[ |
| 688 |
'name' => 'icon_border_hover', |
| 689 |
'label' => esc_html__( 'Border', 'betterdocs' ), |
| 690 |
'selector' => '{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-header:hover .betterdocs-category-icon' |
| 691 |
] |
| 692 |
); |
| 693 |
|
| 694 |
$this->add_responsive_control( |
| 695 |
'icon_border_radius_hover', |
| 696 |
[ |
| 697 |
'label' => esc_html__( 'Border Radius', 'betterdocs' ), |
| 698 |
'type' => Controls_Manager::DIMENSIONS, |
| 699 |
'size_units' => ['px', 'em', '%'], |
| 700 |
'selectors' => [ |
| 701 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-header:hover .betterdocs-category-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 702 |
] |
| 703 |
|
| 704 |
] |
| 705 |
); |
| 706 |
|
| 707 |
$this->add_control( |
| 708 |
'category_settings_icon_size_transition', |
| 709 |
[ |
| 710 |
'label' => __( 'Transition', 'betterdocs' ), |
| 711 |
'type' => Controls_Manager::SLIDER, |
| 712 |
'default' => [ |
| 713 |
'size' => 300, |
| 714 |
'unit' => '%' |
| 715 |
], |
| 716 |
'size_units' => ['%'], |
| 717 |
'range' => [ |
| 718 |
'%' => [ |
| 719 |
'max' => 2500, |
| 720 |
'step' => 1 |
| 721 |
] |
| 722 |
], |
| 723 |
'selectors' => [ |
| 724 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .docs-single-cat-wrap .docs-cat-icon:hover' => 'transition: {{SIZE}}ms;' |
| 725 |
] |
| 726 |
] |
| 727 |
); |
| 728 |
|
| 729 |
$this->end_controls_tab(); |
| 730 |
|
| 731 |
$this->end_controls_tabs(); |
| 732 |
|
| 733 |
$this->end_controls_section(); # end of 'Icon Styles' |
| 734 |
} |
| 735 |
|
| 736 |
public function title_style() { |
| 737 |
/** |
| 738 |
* ---------------------------------------------------------- |
| 739 |
* Section: Title Styles |
| 740 |
* ---------------------------------------------------------- |
| 741 |
*/ |
| 742 |
$this->start_controls_section( |
| 743 |
'section_box_title_styles', |
| 744 |
[ |
| 745 |
'label' => __( 'Title', 'betterdocs' ), |
| 746 |
'tab' => Controls_Manager::TAB_STYLE |
| 747 |
] |
| 748 |
); |
| 749 |
|
| 750 |
$this->start_controls_tabs( 'box_title_styles_tab' ); |
| 751 |
|
| 752 |
// Normal State Tab |
| 753 |
$this->start_controls_tab( |
| 754 |
'title_normal', |
| 755 |
['label' => esc_html__( 'Normal', 'betterdocs' )] |
| 756 |
); |
| 757 |
|
| 758 |
$this->add_control( |
| 759 |
'cat_title_color_normal', |
| 760 |
[ |
| 761 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 762 |
'type' => Controls_Manager::COLOR, |
| 763 |
'selectors' => [ |
| 764 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-title a, {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-title:not(a), {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-category-list-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-title:not(a)' => 'color: {{VALUE}};' |
| 765 |
] |
| 766 |
] |
| 767 |
); |
| 768 |
|
| 769 |
$this->add_group_control( |
| 770 |
Group_Control_Background::get_type(), |
| 771 |
[ |
| 772 |
'name' => 'card_bg_normal_header', |
| 773 |
'types' => ['classic', 'gradient'], |
| 774 |
'selector' => '{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-single-category-wrapper .betterdocs-category-header, {{WRAPPER}} .betterdocs-category-list-wrapper .betterdocs-category-list-inner-wrapper .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-category-header' |
| 775 |
] |
| 776 |
); |
| 777 |
|
| 778 |
$this->add_group_control( |
| 779 |
Group_Control_Typography::get_type(), |
| 780 |
[ |
| 781 |
'name' => 'cat_title_typography_normal', |
| 782 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-title a, {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-title:not(a), {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-category-list-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-title:not(a)' |
| 783 |
] |
| 784 |
); |
| 785 |
|
| 786 |
$this->add_responsive_control( |
| 787 |
'title_spacing', |
| 788 |
[ |
| 789 |
'label' => __( 'Margin', 'betterdocs' ), |
| 790 |
'type' => Controls_Manager::DIMENSIONS, |
| 791 |
'size_units' => ['px', '%', 'em'], |
| 792 |
'selectors' => [ |
| 793 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-title a, {{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-title:not(a), {{WRAPPER}} .betterdocs-category-list-wrapper .betterdocs-category-title:not(a)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 794 |
] |
| 795 |
] |
| 796 |
); |
| 797 |
|
| 798 |
$this->add_responsive_control( |
| 799 |
'title_padding', |
| 800 |
[ |
| 801 |
'label' => __( 'Padding', 'betterdocs' ), |
| 802 |
'type' => Controls_Manager::DIMENSIONS, |
| 803 |
'size_units' => ['px', '%', 'em'], |
| 804 |
'selectors' => [ |
| 805 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-title a, {{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-title:not(a), {{WRAPPER}} .betterdocs-category-list-wrapper .betterdocs-category-title:not(a)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 806 |
] |
| 807 |
] |
| 808 |
); |
| 809 |
|
| 810 |
$this->end_controls_tab(); |
| 811 |
|
| 812 |
// Hover State Tab |
| 813 |
$this->start_controls_tab( |
| 814 |
'title_hover', |
| 815 |
['label' => esc_html__( 'Hover', 'betterdocs' )] |
| 816 |
); |
| 817 |
|
| 818 |
$this->add_control( |
| 819 |
'cat_title_color_hover', |
| 820 |
[ |
| 821 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 822 |
'type' => Controls_Manager::COLOR, |
| 823 |
'selectors' => [ |
| 824 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header:hover .betterdocs-category-title a, {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header:hover .betterdocs-category-title:not(a), {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-category-list-inner-wrapper .betterdocs-category-header:hover .betterdocs-category-title:not(a)' => 'color: {{VALUE}};' |
| 825 |
] |
| 826 |
] |
| 827 |
); |
| 828 |
|
| 829 |
$this->add_group_control( |
| 830 |
Group_Control_Background::get_type(), |
| 831 |
[ |
| 832 |
'name' => 'card_bg_hover_header', |
| 833 |
'types' => ['classic', 'gradient'], |
| 834 |
'selector' => '{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-single-category-wrapper .betterdocs-category-header:hover, {{WRAPPER}} .betterdocs-category-list-wrapper .betterdocs-category-list-inner-wrapper .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-category-header:hover' |
| 835 |
] |
| 836 |
); |
| 837 |
|
| 838 |
$this->add_control( |
| 839 |
'category_title_transition', |
| 840 |
[ |
| 841 |
'label' => __( 'Transition', 'betterdocs' ), |
| 842 |
'type' => Controls_Manager::SLIDER, |
| 843 |
'default' => [ |
| 844 |
'size' => 300, |
| 845 |
'unit' => '%' |
| 846 |
], |
| 847 |
'size_units' => ['%'], |
| 848 |
'range' => [ |
| 849 |
'%' => [ |
| 850 |
'max' => 2500, |
| 851 |
'step' => 1 |
| 852 |
] |
| 853 |
], |
| 854 |
'selectors' => [ |
| 855 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-header' => 'transition: {{SIZE}}ms;' |
| 856 |
] |
| 857 |
] |
| 858 |
); |
| 859 |
|
| 860 |
$this->end_controls_tab(); |
| 861 |
|
| 862 |
$this->end_controls_tab(); |
| 863 |
|
| 864 |
$this->start_controls_tab( |
| 865 |
'card_active', |
| 866 |
['label' => esc_html__( 'Active', 'betterdocs' )] |
| 867 |
); |
| 868 |
|
| 869 |
$this->add_control( |
| 870 |
'cat_title_active_color', |
| 871 |
[ |
| 872 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 873 |
'type' => Controls_Manager::COLOR, |
| 874 |
'selectors' => [ |
| 875 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-single-category-wrapper.active .betterdocs-category-header .betterdocs-category-title a, {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-single-category-wrapper.active .betterdocs-category-header .betterdocs-category-title:not(a), {{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-list-wrapper .betterdocs-category-list-inner-wrapper .betterdocs-category-header .betterdocs-category-title:not(a)' => 'color: {{VALUE}};' |
| 876 |
] |
| 877 |
] |
| 878 |
); |
| 879 |
|
| 880 |
$this->add_group_control( |
| 881 |
Group_Control_Background::get_type(), |
| 882 |
[ |
| 883 |
'name' => 'card_bg_active_header', |
| 884 |
'types' => ['classic', 'gradient'], |
| 885 |
'selector' => '{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-single-category-wrapper.active .betterdocs-category-header', |
| 886 |
'exclude' => [ |
| 887 |
'image' |
| 888 |
] |
| 889 |
] |
| 890 |
); |
| 891 |
|
| 892 |
$this->add_control( |
| 893 |
'cat_title_active_border_color', |
| 894 |
[ |
| 895 |
'label' => esc_html__( 'Border Color', 'betterdocs' ), |
| 896 |
'type' => Controls_Manager::COLOR, |
| 897 |
'default' => '#5a94ff', |
| 898 |
'selectors' => [ |
| 899 |
'{{WRAPPER}} .betterdocs-sidebar.betterdocs-sidebar-layout-1 .betterdocs-sidebar-content .betterdocs-single-category-wrapper.active .betterdocs-single-category-inner .betterdocs-category-header' => 'border-color: {{VALUE}};' |
| 900 |
], |
| 901 |
'condition' => [ |
| 902 |
'betterdocs_sidebar_layout' => 'layout-1' |
| 903 |
] |
| 904 |
] |
| 905 |
); |
| 906 |
|
| 907 |
$this->end_controls_tab(); |
| 908 |
|
| 909 |
$this->end_controls_tabs(); |
| 910 |
|
| 911 |
$this->end_controls_section(); # end of 'Icon Styles' |
| 912 |
} |
| 913 |
|
| 914 |
public function count_style() { |
| 915 |
/** |
| 916 |
* ---------------------------------------------------------- |
| 917 |
* Section: Count Styles |
| 918 |
* ---------------------------------------------------------- |
| 919 |
*/ |
| 920 |
$this->start_controls_section( |
| 921 |
'section_box_count_styles', |
| 922 |
[ |
| 923 |
'label' => __( 'Count', 'betterdocs' ), |
| 924 |
'tab' => Controls_Manager::TAB_STYLE |
| 925 |
] |
| 926 |
); |
| 927 |
|
| 928 |
$this->add_group_control( |
| 929 |
Group_Control_Typography::get_type(), |
| 930 |
[ |
| 931 |
'name' => 'count_typography_normal', |
| 932 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts span' |
| 933 |
] |
| 934 |
); |
| 935 |
|
| 936 |
$this->start_controls_tabs( 'box_count_styles_tab' ); |
| 937 |
|
| 938 |
// Normal State Tab |
| 939 |
$this->start_controls_tab( |
| 940 |
'count_normal', |
| 941 |
['label' => esc_html__( 'Normal', 'betterdocs' )] |
| 942 |
); |
| 943 |
|
| 944 |
$this->add_control( |
| 945 |
'count_color_normal', |
| 946 |
[ |
| 947 |
'label' => esc_html__( 'Text Color', 'betterdocs' ), |
| 948 |
'type' => Controls_Manager::COLOR, |
| 949 |
'selectors' => [ |
| 950 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts span' => 'color: {{VALUE}};' |
| 951 |
] |
| 952 |
] |
| 953 |
); |
| 954 |
|
| 955 |
$this->add_group_control( |
| 956 |
Group_Control_Background::get_type(), |
| 957 |
[ |
| 958 |
'name' => 'count_box_bg', |
| 959 |
'types' => ['classic', 'gradient'], |
| 960 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts', |
| 961 |
'exclude' => [ |
| 962 |
'image' |
| 963 |
] |
| 964 |
] |
| 965 |
); |
| 966 |
|
| 967 |
$this->add_group_control( |
| 968 |
Group_Control_Border::get_type(), |
| 969 |
[ |
| 970 |
'name' => 'count_box_border', |
| 971 |
'label' => esc_html__( 'Border', 'betterdocs' ), |
| 972 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts' |
| 973 |
] |
| 974 |
); |
| 975 |
|
| 976 |
$this->add_responsive_control( |
| 977 |
'count_box_border_radius', |
| 978 |
[ |
| 979 |
'label' => esc_html__( 'Border Radius', 'betterdocs' ), |
| 980 |
'type' => Controls_Manager::DIMENSIONS, |
| 981 |
'size_units' => ['px', 'em', '%'], |
| 982 |
'selectors' => [ |
| 983 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 984 |
] |
| 985 |
] |
| 986 |
); |
| 987 |
|
| 988 |
$this->add_group_control( |
| 989 |
Group_Control_Box_Shadow::get_type(), |
| 990 |
[ |
| 991 |
'name' => 'count_box_box_shadow', |
| 992 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts' |
| 993 |
] |
| 994 |
); |
| 995 |
|
| 996 |
$this->add_responsive_control( |
| 997 |
'count_box_size', |
| 998 |
[ |
| 999 |
'label' => esc_html__( 'Size', 'betterdocs' ), |
| 1000 |
'type' => Controls_Manager::SLIDER, |
| 1001 |
'size_units' => ['px', '%', 'em'], |
| 1002 |
'range' => [ |
| 1003 |
'px' => [ |
| 1004 |
'max' => 500 |
| 1005 |
] |
| 1006 |
], |
| 1007 |
'selectors' => [ |
| 1008 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};' |
| 1009 |
] |
| 1010 |
] |
| 1011 |
); |
| 1012 |
|
| 1013 |
$this->add_responsive_control( |
| 1014 |
'count_spacing', |
| 1015 |
[ |
| 1016 |
'label' => __( 'Spacing', 'betterdocs' ), |
| 1017 |
'type' => Controls_Manager::DIMENSIONS, |
| 1018 |
'size_units' => ['px', '%', 'em'], |
| 1019 |
'selectors' => [ |
| 1020 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1021 |
] |
| 1022 |
] |
| 1023 |
); |
| 1024 |
|
| 1025 |
$this->add_control( |
| 1026 |
'second_color_seperator', |
| 1027 |
[ |
| 1028 |
'label' => esc_html__( 'Second Color', 'textdomain' ), |
| 1029 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 1030 |
'separator' => 'before', |
| 1031 |
'condition' => [ |
| 1032 |
'betterdocs_sidebar_layout' => 'layout-1' |
| 1033 |
] |
| 1034 |
] |
| 1035 |
); |
| 1036 |
|
| 1037 |
$this->add_group_control( |
| 1038 |
Group_Control_Background::get_type(), |
| 1039 |
[ |
| 1040 |
'name' => 'count_box_bg_second', |
| 1041 |
'types' => ['classic', 'gradient'], |
| 1042 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts span', |
| 1043 |
'exclude' => [ |
| 1044 |
'image' |
| 1045 |
], |
| 1046 |
'condition' => [ |
| 1047 |
'betterdocs_sidebar_layout' => 'layout-1' |
| 1048 |
] |
| 1049 |
], |
| 1050 |
); |
| 1051 |
|
| 1052 |
$this->end_controls_tab(); |
| 1053 |
|
| 1054 |
// Hover State Tab |
| 1055 |
$this->start_controls_tab( |
| 1056 |
'count_hover', |
| 1057 |
['label' => esc_html__( 'Hover', 'betterdocs' )] |
| 1058 |
); |
| 1059 |
|
| 1060 |
$this->add_control( |
| 1061 |
'count_color_hover', |
| 1062 |
[ |
| 1063 |
'label' => esc_html__( 'Text Color', 'betterdocs' ), |
| 1064 |
'type' => Controls_Manager::COLOR, |
| 1065 |
'selectors' => [ |
| 1066 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts:hover span' => 'color: {{VALUE}};' |
| 1067 |
] |
| 1068 |
] |
| 1069 |
); |
| 1070 |
|
| 1071 |
$this->add_group_control( |
| 1072 |
Group_Control_Background::get_type(), |
| 1073 |
[ |
| 1074 |
'name' => 'count_box_bg_hover', |
| 1075 |
'types' => ['classic', 'gradient'], |
| 1076 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts:hover', |
| 1077 |
'exclude' => [ |
| 1078 |
'image' |
| 1079 |
], |
| 1080 |
] |
| 1081 |
); |
| 1082 |
|
| 1083 |
$this->add_group_control( |
| 1084 |
Group_Control_Border::get_type(), |
| 1085 |
[ |
| 1086 |
'name' => 'count_box_border_hover', |
| 1087 |
'label' => esc_html__( 'Border', 'betterdocs' ), |
| 1088 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts:hover' |
| 1089 |
|
| 1090 |
] |
| 1091 |
); |
| 1092 |
|
| 1093 |
$this->add_responsive_control( |
| 1094 |
'count_box_border_radius_hover', |
| 1095 |
[ |
| 1096 |
'label' => esc_html__( 'Border Radius', 'betterdocs' ), |
| 1097 |
'type' => Controls_Manager::DIMENSIONS, |
| 1098 |
'size_units' => ['px', 'em', '%'], |
| 1099 |
'selectors' => [ |
| 1100 |
'{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1101 |
] |
| 1102 |
|
| 1103 |
] |
| 1104 |
); |
| 1105 |
|
| 1106 |
$this->add_group_control( |
| 1107 |
Group_Control_Box_Shadow::get_type(), |
| 1108 |
[ |
| 1109 |
'name' => 'count_box_box_shadow_hover', |
| 1110 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts:hover' |
| 1111 |
] |
| 1112 |
); |
| 1113 |
|
| 1114 |
$this->add_control( |
| 1115 |
'category_count_transition', |
| 1116 |
[ |
| 1117 |
'label' => __( 'Transition', 'betterdocs' ), |
| 1118 |
'type' => Controls_Manager::SLIDER, |
| 1119 |
'default' => [ |
| 1120 |
'size' => 300, |
| 1121 |
'unit' => '%' |
| 1122 |
], |
| 1123 |
'size_units' => ['%'], |
| 1124 |
'range' => [ |
| 1125 |
'%' => [ |
| 1126 |
'max' => 2500, |
| 1127 |
'step' => 1 |
| 1128 |
] |
| 1129 |
], |
| 1130 |
'selectors' => [ |
| 1131 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-category-items-counts:hover' => 'transition: {{SIZE}}ms;' |
| 1132 |
|
| 1133 |
] |
| 1134 |
] |
| 1135 |
); |
| 1136 |
|
| 1137 |
$this->add_control( |
| 1138 |
'hover_second_color_seperator', |
| 1139 |
[ |
| 1140 |
'label' => esc_html__( 'Second Color', 'textdomain' ), |
| 1141 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 1142 |
'separator' => 'before', |
| 1143 |
'condition' => [ |
| 1144 |
'betterdocs_sidebar_layout' => 'layout-1' |
| 1145 |
] |
| 1146 |
] |
| 1147 |
); |
| 1148 |
|
| 1149 |
$this->add_group_control( |
| 1150 |
Group_Control_Background::get_type(), |
| 1151 |
[ |
| 1152 |
'name' => 'count_box_bg_second_hover', |
| 1153 |
'types' => ['classic', 'gradient'], |
| 1154 |
'selector' => '{{WRAPPER}} .betterdocs-sidebar .betterdocs-sidebar-content .betterdocs-category-grid-wrapper .betterdocs-category-grid-inner-wrapper .betterdocs-category-header .betterdocs-category-header-inner .betterdocs-category-items-counts:hover span', |
| 1155 |
'exclude' => [ |
| 1156 |
'image' |
| 1157 |
], |
| 1158 |
'condition' => [ |
| 1159 |
'betterdocs_sidebar_layout' => 'layout-1' |
| 1160 |
] |
| 1161 |
], |
| 1162 |
); |
| 1163 |
|
| 1164 |
$this->end_controls_tab(); |
| 1165 |
|
| 1166 |
$this->end_controls_tabs(); |
| 1167 |
|
| 1168 |
$this->end_controls_section(); # end of 'Count Styles' |
| 1169 |
} |
| 1170 |
|
| 1171 |
public function list_setting() { |
| 1172 |
/** |
| 1173 |
* ---------------------------------------------------------- |
| 1174 |
* Section: List Settinggs |
| 1175 |
* ---------------------------------------------------------- |
| 1176 |
*/ |
| 1177 |
$this->start_controls_section( |
| 1178 |
'section_article_settings', |
| 1179 |
[ |
| 1180 |
'label' => __( 'Category List', 'betterdocs' ), |
| 1181 |
'tab' => Controls_Manager::TAB_STYLE |
| 1182 |
] |
| 1183 |
); |
| 1184 |
|
| 1185 |
$this->add_group_control( |
| 1186 |
Group_Control_Typography::get_type(), |
| 1187 |
[ |
| 1188 |
'name' => 'list_item_typography', |
| 1189 |
'selector' => '{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li a' |
| 1190 |
] |
| 1191 |
); |
| 1192 |
|
| 1193 |
$this->add_control( |
| 1194 |
'list_color', |
| 1195 |
[ |
| 1196 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 1197 |
'type' => Controls_Manager::COLOR, |
| 1198 |
'selectors' => [ |
| 1199 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li a' => 'color: {{VALUE}};' |
| 1200 |
] |
| 1201 |
] |
| 1202 |
); |
| 1203 |
|
| 1204 |
$this->add_control( |
| 1205 |
'list_hover_color', |
| 1206 |
[ |
| 1207 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 1208 |
'type' => Controls_Manager::COLOR, |
| 1209 |
'selectors' => [ |
| 1210 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li a:hover' => 'color: {{VALUE}};' |
| 1211 |
] |
| 1212 |
] |
| 1213 |
); |
| 1214 |
|
| 1215 |
$this->add_responsive_control( |
| 1216 |
'list_margin', |
| 1217 |
[ |
| 1218 |
'label' => esc_html__( 'List Item Spacing', 'betterdocs' ), |
| 1219 |
'type' => Controls_Manager::DIMENSIONS, |
| 1220 |
'size_units' => ['px', 'em', '%'], |
| 1221 |
'selectors' => [ |
| 1222 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1223 |
] |
| 1224 |
] |
| 1225 |
); |
| 1226 |
|
| 1227 |
$this->add_responsive_control( |
| 1228 |
'list_area_padding', |
| 1229 |
[ |
| 1230 |
'label' => esc_html__( 'List Area Padding', 'betterdocs' ), |
| 1231 |
'type' => Controls_Manager::DIMENSIONS, |
| 1232 |
'allowed_dimensions' => 'vertical', |
| 1233 |
'size_units' => ['px', 'em', '%'], |
| 1234 |
'selectors' => [ |
| 1235 |
'{{WRAPPER}} .betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper .betterdocs-body' => 'padding-top: {{TOP}}{{UNIT}}; padding-bottom: {{BOTTOM}}{{UNIT}};' |
| 1236 |
] |
| 1237 |
] |
| 1238 |
); |
| 1239 |
|
| 1240 |
$this->add_control( |
| 1241 |
'icon_settings_heading', |
| 1242 |
[ |
| 1243 |
'label' => esc_html__( 'Icon', 'betterdocs' ), |
| 1244 |
'type' => Controls_Manager::HEADING, |
| 1245 |
'separator' => 'before' |
| 1246 |
] |
| 1247 |
); |
| 1248 |
|
| 1249 |
$this->add_control( |
| 1250 |
'list_icon_color', |
| 1251 |
[ |
| 1252 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 1253 |
'type' => Controls_Manager::COLOR, |
| 1254 |
'selectors' => [ |
| 1255 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li svg' => 'fill: {{VALUE}};' |
| 1256 |
] |
| 1257 |
] |
| 1258 |
); |
| 1259 |
|
| 1260 |
$this->add_responsive_control( |
| 1261 |
'list_icon_size', |
| 1262 |
[ |
| 1263 |
'label' => __( 'Size', 'betterdocs' ), |
| 1264 |
'type' => Controls_Manager::SLIDER, |
| 1265 |
'size_units' => ['px', '%', 'em'], |
| 1266 |
'range' => [ |
| 1267 |
'%' => [ |
| 1268 |
'max' => 100, |
| 1269 |
'step' => 1 |
| 1270 |
] |
| 1271 |
], |
| 1272 |
'selectors' => [ |
| 1273 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li svg' => 'width: {{SIZE}}{{UNIT}};', |
| 1274 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li .betterdocs-nested-category-title svg' => 'font-size: {{SIZE}}{{UNIT}};' |
| 1275 |
] |
| 1276 |
] |
| 1277 |
); |
| 1278 |
|
| 1279 |
$this->add_responsive_control( |
| 1280 |
'list_icon_spacing', |
| 1281 |
[ |
| 1282 |
'label' => esc_html__( 'Spacing', 'betterdocs' ), |
| 1283 |
'type' => Controls_Manager::DIMENSIONS, |
| 1284 |
'size_units' => ['px', 'em', '%'], |
| 1285 |
'selectors' => [ |
| 1286 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list li svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1287 |
] |
| 1288 |
] |
| 1289 |
); |
| 1290 |
|
| 1291 |
$this->end_controls_section(); # end of 'Column Settings' |
| 1292 |
} |
| 1293 |
|
| 1294 |
/** |
| 1295 |
* ---------------------------------------------------------- |
| 1296 |
* Section: Sub List Settinggs |
| 1297 |
* ---------------------------------------------------------- |
| 1298 |
*/ |
| 1299 |
public function sub_list_setting() { |
| 1300 |
|
| 1301 |
$this->start_controls_section( |
| 1302 |
'section_sub_list_settings', |
| 1303 |
[ |
| 1304 |
'label' => __( 'Sub-Category List', 'betterdocs' ), |
| 1305 |
'tab' => Controls_Manager::TAB_STYLE |
| 1306 |
] |
| 1307 |
); |
| 1308 |
|
| 1309 |
$this->add_group_control( |
| 1310 |
Group_Control_Typography::get_type(), |
| 1311 |
[ |
| 1312 |
'name' => 'sub_list_item_typography', |
| 1313 |
'selector' => '{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list .betterdocs-nested-category-list li a' |
| 1314 |
] |
| 1315 |
); |
| 1316 |
|
| 1317 |
$this->add_control( |
| 1318 |
'sub_list_color', |
| 1319 |
[ |
| 1320 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 1321 |
'type' => Controls_Manager::COLOR, |
| 1322 |
'selectors' => [ |
| 1323 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list .betterdocs-nested-category-list a' => 'color: {{VALUE}};' |
| 1324 |
] |
| 1325 |
] |
| 1326 |
); |
| 1327 |
|
| 1328 |
$this->add_control( |
| 1329 |
'sub_list_hover_color', |
| 1330 |
[ |
| 1331 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 1332 |
'type' => Controls_Manager::COLOR, |
| 1333 |
'selectors' => [ |
| 1334 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list .betterdocs-nested-category-list a:hover' => 'color: {{VALUE}};' |
| 1335 |
] |
| 1336 |
] |
| 1337 |
); |
| 1338 |
|
| 1339 |
$this->add_responsive_control( |
| 1340 |
'sub_list_margin', |
| 1341 |
[ |
| 1342 |
'label' => esc_html__( 'List Item Spacing', 'betterdocs' ), |
| 1343 |
'type' => Controls_Manager::DIMENSIONS, |
| 1344 |
'size_units' => ['px', 'em', '%'], |
| 1345 |
'selectors' => [ |
| 1346 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list .betterdocs-nested-category-list li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1347 |
] |
| 1348 |
] |
| 1349 |
); |
| 1350 |
|
| 1351 |
$this->add_responsive_control( |
| 1352 |
'sub_list_area_padding', |
| 1353 |
[ |
| 1354 |
'label' => esc_html__( 'List Area Padding', 'betterdocs' ), |
| 1355 |
'type' => Controls_Manager::DIMENSIONS, |
| 1356 |
'allowed_dimensions' => 'vertical', |
| 1357 |
'size_units' => ['px', 'em', '%'], |
| 1358 |
'selectors' => [ |
| 1359 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list .betterdocs-nested-category-list li' => 'padding-top: {{TOP}}{{UNIT}}; padding-bottom: {{BOTTOM}}{{UNIT}};' |
| 1360 |
] |
| 1361 |
] |
| 1362 |
); |
| 1363 |
|
| 1364 |
$this->add_responsive_control( |
| 1365 |
'sub_list_icon_spacing', |
| 1366 |
[ |
| 1367 |
'label' => esc_html__( 'Spacing', 'betterdocs' ), |
| 1368 |
'type' => Controls_Manager::DIMENSIONS, |
| 1369 |
'size_units' => ['px', 'em', '%'], |
| 1370 |
'selectors' => [ |
| 1371 |
'{{WRAPPER}} .betterdocs-single-category-wrapper .betterdocs-single-category-inner .betterdocs-articles-list .betterdocs-nested-category-list li svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1372 |
] |
| 1373 |
] |
| 1374 |
); |
| 1375 |
|
| 1376 |
$this->end_controls_section(); # end of 'Column Settings' |
| 1377 |
} |
| 1378 |
|
| 1379 |
protected function render_callback() { |
| 1380 |
$settings = $this->get_settings_for_display(); |
| 1381 |
$this->attributes = &$settings; |
| 1382 |
|
| 1383 |
$layout = isset( $settings['betterdocs_sidebar_layout'] ) ? $settings['betterdocs_sidebar_layout'] : 'layout-1'; |
| 1384 |
$layout = str_replace( 'layout-', '', $layout ); |
| 1385 |
|
| 1386 |
$sidebar_layout = $layout; |
| 1387 |
|
| 1388 |
if ( ! betterdocs()->is_pro_active() && ( $sidebar_layout == 2 || $sidebar_layout == 3 ) ) { |
| 1389 |
$sidebar_layout = 1; |
| 1390 |
} |
| 1391 |
|
| 1392 |
$this->views( 'templates/sidebars/sidebar-' . $sidebar_layout ); |
| 1393 |
|
| 1394 |
if ( $settings['enable_sticky_toc'] == 1 && $layout == 1 ) { |
| 1395 |
betterdocs()->views->get( 'templates/parts/sticky-toc' ); |
| 1396 |
} |
| 1397 |
|
| 1398 |
if( Plugin::instance()->editor->is_edit_mode() ) { |
| 1399 |
$this->render_editor_script(); |
| 1400 |
} |
| 1401 |
} |
| 1402 |
|
| 1403 |
public function view_params() { |
| 1404 |
$settings = &$this->attributes; |
| 1405 |
$default_multiple_kb = (bool) betterdocs()->editor->get( 'elementor' )->multiple_kb_status(); |
| 1406 |
$kb_slug = isset( $settings['selected_knowledge_base'] ) ? $settings['selected_knowledge_base'] : ''; |
| 1407 |
|
| 1408 |
$params = [ |
| 1409 |
'wrapper_attr' => [ |
| 1410 |
'class' => [ 'betterdocs-elementor-single-sidebar' ] |
| 1411 |
], |
| 1412 |
'shortcode_attr' => [ |
| 1413 |
'terms_order' => $settings['order'], |
| 1414 |
'terms_orderby' => $settings['orderby'], |
| 1415 |
'terms_include' => array_diff( $settings['include'], (array) $settings['exclude'] ), |
| 1416 |
'terms_exclude' => $settings['exclude'], |
| 1417 |
'terms_offset' => $settings['offset'], |
| 1418 |
'nested_subcategory' => $settings['nested_subcategory'], |
| 1419 |
'multiple_knowledge_base' => $default_multiple_kb, |
| 1420 |
'kb_slug' => $kb_slug, |
| 1421 |
'sidebar_list' => true, |
| 1422 |
'disable_customizer_style' => true, |
| 1423 |
'posts_per_page' => -1, |
| 1424 |
'title_tag' => $settings['category_title_tag'] |
| 1425 |
], |
| 1426 |
]; |
| 1427 |
|
| 1428 |
if( $settings['betterdocs_sidebar_layout'] == 'layout-1') { |
| 1429 |
$params['shortcode_attr'][ 'show_icon' ] = $settings['show_icon']; |
| 1430 |
$params['shortcode_attr'][ 'show_count' ] = $settings['show_count']; |
| 1431 |
} |
| 1432 |
|
| 1433 |
if( $settings['betterdocs_sidebar_layout'] == 'layout-4' || $settings['betterdocs_sidebar_layout'] == 'layout-3' ) { |
| 1434 |
$params['shortcode_attr'][ 'show_icon' ] = false; |
| 1435 |
$params['shortcode_attr'][ 'show_count' ] = false; |
| 1436 |
} |
| 1437 |
|
| 1438 |
return $params; |
| 1439 |
} |
| 1440 |
|
| 1441 |
public function render_editor_script() { |
| 1442 |
$this->views( 'templates/sidebars/editor' ); |
| 1443 |
} |
| 1444 |
} |
| 1445 |
|