| 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\Plugin as ElementorPlugin; |
| 9 |
use Elementor\Controls_Manager; |
| 10 |
use Elementor\Group_Control_Typography; |
| 11 |
use ElementorPro\Base\Base_Widget_Trait; |
| 12 |
use WPDeveloper\BetterDocs\Editors\Elementor\BaseWidget; |
| 13 |
|
| 14 |
class ArchiveList extends BaseWidget { |
| 15 |
|
| 16 |
use Base_Widget_Trait; |
| 17 |
|
| 18 |
public function get_name() { |
| 19 |
return 'betterdocs-category-archive-list'; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_title() { |
| 23 |
return __( 'Doc Category Archive List', 'betterdocs' ); |
| 24 |
} |
| 25 |
|
| 26 |
public function get_icon() { |
| 27 |
return 'eicon-post-list betterdocs-eicon-post-list'; |
| 28 |
} |
| 29 |
|
| 30 |
public function get_categories() { |
| 31 |
return [ 'betterdocs-elements', 'docs-archive' ]; |
| 32 |
} |
| 33 |
|
| 34 |
public function get_style_depends() { |
| 35 |
return [ 'betterdocs-el-articles-list', 'betterdocs-fontawesome', 'betterdocs-category-archive-doc-list', 'betterdocs-pagination' ]; |
| 36 |
} |
| 37 |
|
| 38 |
public function get_keywords() { |
| 39 |
return [ 'betterdocs-elements', 'title', 'heading', 'betterdocs', 'docs', 'doc-category', 'doc-category-archive' ]; |
| 40 |
} |
| 41 |
|
| 42 |
public function get_custom_help_url() { |
| 43 |
return 'https://betterdocs.co/docs/docs-archive-in-elementor/'; |
| 44 |
} |
| 45 |
|
| 46 |
protected function register_controls() { |
| 47 |
$this->section_content(); |
| 48 |
$this->container_wrapper_section(); |
| 49 |
$this->list_settings(); |
| 50 |
$this->subcat_list_settings(); |
| 51 |
|
| 52 |
$this->container_wrapper_section_layout_2(); |
| 53 |
$this->list_settings_layout_2(); |
| 54 |
|
| 55 |
$this->container_wrapper_section_layout_3(); |
| 56 |
$this->list_settings_layout_3(); |
| 57 |
|
| 58 |
$this->pagination_controls(); |
| 59 |
} |
| 60 |
|
| 61 |
public function section_content() { |
| 62 |
$this->start_controls_section( |
| 63 |
'section_title', |
| 64 |
[ |
| 65 |
'label' => __( 'Controls', 'betterdocs' ) |
| 66 |
] |
| 67 |
); |
| 68 |
|
| 69 |
$this->add_control( |
| 70 |
'section_betterdocs_archive_list_layout', |
| 71 |
[ |
| 72 |
'label' => esc_html__( 'Select layout', 'betterdocs' ), |
| 73 |
'type' => Controls_Manager::SELECT, |
| 74 |
'default' => 'layout-1', |
| 75 |
'label_block' => false, |
| 76 |
'options' => [ |
| 77 |
'layout-1' => esc_html__( 'Layout 1', 'betterdocs' ), |
| 78 |
'layout-2' => esc_html__( 'Layout 2', 'betterdocs' ), |
| 79 |
'layout-3' => esc_html__( 'Layout 3', 'betterdocs' ) |
| 80 |
] |
| 81 |
] |
| 82 |
); |
| 83 |
|
| 84 |
$this->add_control( |
| 85 |
'list_title_tag_layout_2', |
| 86 |
[ |
| 87 |
'label' => __( 'Title Tag', 'betterdocs' ), |
| 88 |
'type' => Controls_Manager::SELECT, |
| 89 |
'default' => 'h3', |
| 90 |
'options' => [ |
| 91 |
'h1' => 'H1', |
| 92 |
'h2' => 'H2', |
| 93 |
'h3' => 'H3', |
| 94 |
'h4' => 'H4', |
| 95 |
'h5' => 'H5', |
| 96 |
'h6' => 'H6', |
| 97 |
'p' => 'P' |
| 98 |
], |
| 99 |
'condition' => [ |
| 100 |
'section_betterdocs_archive_list_layout' => [ 'layout-2', 'layout-3' ] |
| 101 |
] |
| 102 |
] |
| 103 |
); |
| 104 |
|
| 105 |
$this->add_control( |
| 106 |
'alphabetic_order', |
| 107 |
[ |
| 108 |
'label' => __( 'Order By', 'betterdocs' ), |
| 109 |
'type' => Controls_Manager::SELECT, |
| 110 |
'options' => [ |
| 111 |
'none' => __( 'No order', 'betterdocs' ), |
| 112 |
'title' => __( 'Title', 'betterdocs' ), |
| 113 |
'slug' => __( 'Slug', 'betterdocs' ), |
| 114 |
'term_group' => __( 'Term Group', 'betterdocs' ), |
| 115 |
'term_id' => __( 'Term ID', 'betterdocs' ), |
| 116 |
'id' => __( 'ID', 'betterdocs' ), |
| 117 |
'description' => __( 'Description', 'betterdocs' ), |
| 118 |
'parent' => __( 'Parent', 'betterdocs' ), |
| 119 |
'betterdocs_order' => __( 'BetterDocs Order', 'betterdocs' ) |
| 120 |
], |
| 121 |
'default' => 'title' |
| 122 |
] |
| 123 |
); |
| 124 |
|
| 125 |
$this->add_control( |
| 126 |
'order', |
| 127 |
[ |
| 128 |
'label' => __( 'Order', 'betterdocs' ), |
| 129 |
'type' => Controls_Manager::SELECT, |
| 130 |
'options' => [ |
| 131 |
'asc' => 'Ascending', |
| 132 |
'desc' => 'Descending' |
| 133 |
], |
| 134 |
'default' => 'asc' |
| 135 |
|
| 136 |
] |
| 137 |
); |
| 138 |
|
| 139 |
$this->add_control( |
| 140 |
'nested_subcategory', |
| 141 |
[ |
| 142 |
'label' => __( 'Nested Subcategory', 'betterdocs' ), |
| 143 |
'type' => Controls_Manager::SWITCHER, |
| 144 |
'label_on' => __( 'Show', 'betterdocs' ), |
| 145 |
'label_off' => __( 'Hide', 'betterdocs' ), |
| 146 |
'return_value' => '1', |
| 147 |
'default' => '1' |
| 148 |
] |
| 149 |
); |
| 150 |
|
| 151 |
$this->add_control( |
| 152 |
'enable_pagination', |
| 153 |
[ |
| 154 |
'label' => __( 'Enable Pagination', 'betterdocs' ), |
| 155 |
'type' => Controls_Manager::SWITCHER, |
| 156 |
'label_on' => __( 'Show', 'betterdocs' ), |
| 157 |
'label_off' => __( 'Hide', 'betterdocs' ), |
| 158 |
'return_value' => 'true', |
| 159 |
'default' => false, |
| 160 |
'condition' => [ |
| 161 |
'section_betterdocs_archive_list_layout' => [ 'layout-1', 'layout-3' ] |
| 162 |
] |
| 163 |
] |
| 164 |
); |
| 165 |
|
| 166 |
$this->add_control( |
| 167 |
'posts_per_page', |
| 168 |
[ |
| 169 |
'label' => __( 'Posts Per Page', 'betterdocs' ), |
| 170 |
'type' => Controls_Manager::NUMBER, |
| 171 |
'default' => 10, |
| 172 |
'min' => 1, |
| 173 |
'max' => 100, |
| 174 |
'step' => 1, |
| 175 |
'condition' => [ |
| 176 |
'enable_pagination' => 'true', |
| 177 |
'section_betterdocs_archive_list_layout' => [ 'layout-3' ] |
| 178 |
] |
| 179 |
] |
| 180 |
); |
| 181 |
|
| 182 |
$this->add_control( |
| 183 |
'important_note', |
| 184 |
[ |
| 185 |
'type' => Controls_Manager::RAW_HTML, |
| 186 |
'raw' => __( 'Note: This is the preview only for Elementor Editor. You will see the real view in the archive page itself.', 'betterdocs' ), |
| 187 |
'content_classes' => 'betterdocs-elementor-note elementor-panel-alert elementor-panel-alert-info' |
| 188 |
] |
| 189 |
); |
| 190 |
|
| 191 |
$this->end_controls_section(); |
| 192 |
} |
| 193 |
|
| 194 |
public function container_wrapper_section() { |
| 195 |
$this->start_controls_section( |
| 196 |
'archive_list_container_section', |
| 197 |
[ |
| 198 |
'label' => __( 'Container Section', 'betterdocs' ), |
| 199 |
'tab' => Controls_Manager::TAB_STYLE, |
| 200 |
'condition' => [ |
| 201 |
'section_betterdocs_archive_list_layout' => [ 'layout-1' ] |
| 202 |
] |
| 203 |
] |
| 204 |
); |
| 205 |
|
| 206 |
$this->add_responsive_control( |
| 207 |
'archive_list_container_padding', |
| 208 |
[ |
| 209 |
'label' => __( 'Padding', 'betterdocs' ), |
| 210 |
'type' => Controls_Manager::DIMENSIONS, |
| 211 |
'size_units' => [ 'px', 'em', '%' ], |
| 212 |
'selectors' => [ |
| 213 |
'{{WRAPPER}} .betterdocs-articles-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 214 |
] |
| 215 |
] |
| 216 |
); |
| 217 |
|
| 218 |
$this->add_responsive_control( |
| 219 |
'archive_list_container_margin', |
| 220 |
[ |
| 221 |
'label' => __( 'Margin', 'betterdocs' ), |
| 222 |
'type' => Controls_Manager::DIMENSIONS, |
| 223 |
'size_units' => [ 'px', '%', 'em' ], |
| 224 |
'selectors' => [ |
| 225 |
'{{WRAPPER}} .betterdocs-articles-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 226 |
] |
| 227 |
] |
| 228 |
); |
| 229 |
|
| 230 |
$this->end_controls_section(); |
| 231 |
} |
| 232 |
|
| 233 |
public function container_wrapper_section_layout_2() { |
| 234 |
$this->start_controls_section( |
| 235 |
'archive_list_container_section_layout_2', |
| 236 |
[ |
| 237 |
'label' => __( 'Container Section', 'betterdocs' ), |
| 238 |
'tab' => Controls_Manager::TAB_STYLE, |
| 239 |
'condition' => [ |
| 240 |
'section_betterdocs_archive_list_layout' => [ 'layout-2' ] |
| 241 |
] |
| 242 |
] |
| 243 |
); |
| 244 |
|
| 245 |
$this->add_responsive_control( |
| 246 |
'archive_list_container_padding_layout_2', |
| 247 |
[ |
| 248 |
'label' => __( 'Padding', 'betterdocs' ), |
| 249 |
'type' => Controls_Manager::DIMENSIONS, |
| 250 |
'size_units' => [ 'px', 'em', '%' ], |
| 251 |
'selectors' => [ |
| 252 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 253 |
] |
| 254 |
] |
| 255 |
); |
| 256 |
|
| 257 |
$this->add_responsive_control( |
| 258 |
'archive_list_container_margin_layout_2', |
| 259 |
[ |
| 260 |
'label' => __( 'Margin', 'betterdocs' ), |
| 261 |
'type' => Controls_Manager::DIMENSIONS, |
| 262 |
'size_units' => [ 'px', '%', 'em' ], |
| 263 |
'selectors' => [ |
| 264 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 265 |
] |
| 266 |
] |
| 267 |
); |
| 268 |
|
| 269 |
$this->end_controls_section(); |
| 270 |
} |
| 271 |
|
| 272 |
public function list_settings() { |
| 273 |
/** |
| 274 |
* ---------------------------------------------------------- |
| 275 |
* Section: List Settinggs |
| 276 |
* ---------------------------------------------------------- |
| 277 |
*/ |
| 278 |
$this->start_controls_section( |
| 279 |
'section_article_settings', |
| 280 |
[ |
| 281 |
'label' => __( 'Category List', 'betterdocs' ), |
| 282 |
'tab' => Controls_Manager::TAB_STYLE, |
| 283 |
'condition' => [ |
| 284 |
'section_betterdocs_archive_list_layout' => [ 'layout-1' ] |
| 285 |
] |
| 286 |
] |
| 287 |
); |
| 288 |
|
| 289 |
$this->add_group_control( |
| 290 |
Group_Control_Typography::get_type(), |
| 291 |
[ |
| 292 |
'name' => 'list_item_typography', |
| 293 |
'selector' => '{{WRAPPER}} .betterdocs-articles-list li a' |
| 294 |
] |
| 295 |
); |
| 296 |
|
| 297 |
$this->add_control( |
| 298 |
'list_word_wrap', |
| 299 |
[ |
| 300 |
'label' => __( 'Word Wrap', 'betterdocs' ), |
| 301 |
'type' => Controls_Manager::SELECT2, |
| 302 |
'multiple' => false, |
| 303 |
'options' => [ |
| 304 |
'normal' => 'normal', |
| 305 |
'break-word' => 'break-word', |
| 306 |
'initial' => 'initial', |
| 307 |
'inherit' => 'inherit' |
| 308 |
], |
| 309 |
'default' => 'normal', |
| 310 |
'selectors' => [ |
| 311 |
'{{WRAPPER}} .betterdocs-articles-list li a' => 'word-wrap: {{VALUE}};' |
| 312 |
] |
| 313 |
] |
| 314 |
); |
| 315 |
|
| 316 |
$this->add_control( |
| 317 |
'list_color', |
| 318 |
[ |
| 319 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 320 |
'type' => Controls_Manager::COLOR, |
| 321 |
'selectors' => [ |
| 322 |
'{{WRAPPER}} .betterdocs-articles-list li a' => 'color: {{VALUE}};' |
| 323 |
] |
| 324 |
] |
| 325 |
); |
| 326 |
|
| 327 |
$this->add_control( |
| 328 |
'list_hover_color', |
| 329 |
[ |
| 330 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 331 |
'type' => Controls_Manager::COLOR, |
| 332 |
'selectors' => [ |
| 333 |
'{{WRAPPER}} .betterdocs-articles-list li a:hover' => 'color: {{VALUE}};' |
| 334 |
] |
| 335 |
] |
| 336 |
); |
| 337 |
|
| 338 |
$this->add_responsive_control( |
| 339 |
'list_margin', |
| 340 |
[ |
| 341 |
'label' => esc_html__( 'List Item Spacing', 'betterdocs' ), |
| 342 |
'type' => Controls_Manager::DIMENSIONS, |
| 343 |
'size_units' => [ 'px', 'em', '%' ], |
| 344 |
'selectors' => [ |
| 345 |
'{{WRAPPER}} .betterdocs-articles-list li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 346 |
] |
| 347 |
] |
| 348 |
); |
| 349 |
|
| 350 |
$this->add_control( |
| 351 |
'icon_settings_heading', |
| 352 |
[ |
| 353 |
'label' => esc_html__( 'List Icon', 'betterdocs' ), |
| 354 |
'type' => Controls_Manager::HEADING, |
| 355 |
'separator' => 'before' |
| 356 |
] |
| 357 |
); |
| 358 |
|
| 359 |
$this->add_control( |
| 360 |
'list_icon', |
| 361 |
[ |
| 362 |
'label' => __( 'Icon', 'betterdocs' ), |
| 363 |
'type' => Controls_Manager::ICONS, |
| 364 |
'default' => [ |
| 365 |
'value' => 'far fa-file-alt', |
| 366 |
'library' => 'fa-regular' |
| 367 |
] |
| 368 |
] |
| 369 |
); |
| 370 |
|
| 371 |
$this->add_control( |
| 372 |
'list_icon_color', |
| 373 |
[ |
| 374 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 375 |
'type' => Controls_Manager::COLOR, |
| 376 |
'selectors' => [ |
| 377 |
'{{WRAPPER}} .betterdocs-articles-list li svg' => 'fill: {{VALUE}};', |
| 378 |
'{{WRAPPER}} .betterdocs-articles-list li i' => 'color: {{VALUE}};' |
| 379 |
] |
| 380 |
] |
| 381 |
); |
| 382 |
|
| 383 |
$this->add_responsive_control( |
| 384 |
'list_icon_size', |
| 385 |
[ |
| 386 |
'label' => __( 'Size', 'betterdocs' ), |
| 387 |
'type' => Controls_Manager::SLIDER, |
| 388 |
'size_units' => [ 'px', '%', 'em' ], |
| 389 |
'range' => [ |
| 390 |
'%' => [ |
| 391 |
'max' => 100, |
| 392 |
'step' => 1 |
| 393 |
] |
| 394 |
], |
| 395 |
'selectors' => [ |
| 396 |
'{{WRAPPER}} .betterdocs-articles-list li svg' => 'width: {{SIZE}}{{UNIT}};', |
| 397 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-title svg' => 'width: {{SIZE}}{{UNIT}};', |
| 398 |
'{{WRAPPER}} .betterdocs-articles-list li i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 399 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-title i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 400 |
'{{WRAPPER}} .betterdocs-articles-list li img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 401 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-title img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};' |
| 402 |
] |
| 403 |
] |
| 404 |
); |
| 405 |
|
| 406 |
$this->add_responsive_control( |
| 407 |
'list_icon_spacing', |
| 408 |
[ |
| 409 |
'label' => esc_html__( 'Spacing', 'betterdocs' ), |
| 410 |
'type' => Controls_Manager::DIMENSIONS, |
| 411 |
'size_units' => [ 'px', 'em', '%' ], |
| 412 |
'default' => [ |
| 413 |
'top' => 0, |
| 414 |
'right' => 5, |
| 415 |
'bottom' => 0, |
| 416 |
'left' => 0, |
| 417 |
'unit' => 'px', |
| 418 |
'isLinked' => false, |
| 419 |
], |
| 420 |
'selectors' => [ |
| 421 |
'{{WRAPPER}} .betterdocs-articles-list li svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 422 |
'{{WRAPPER}} .betterdocs-articles-list li i' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 423 |
] |
| 424 |
] |
| 425 |
); |
| 426 |
|
| 427 |
$this->end_controls_section(); # end of 'Column Settings' |
| 428 |
} |
| 429 |
|
| 430 |
public function list_settings_layout_2() { |
| 431 |
/** |
| 432 |
* ---------------------------------------------------------- |
| 433 |
* Section: List Settinggs |
| 434 |
* ---------------------------------------------------------- |
| 435 |
*/ |
| 436 |
$this->start_controls_section( |
| 437 |
'section_article_settings_layout_2', |
| 438 |
[ |
| 439 |
'label' => __( 'Category List', 'betterdocs' ), |
| 440 |
'tab' => Controls_Manager::TAB_STYLE, |
| 441 |
'condition' => [ |
| 442 |
'section_betterdocs_archive_list_layout' => [ 'layout-2' ] |
| 443 |
] |
| 444 |
] |
| 445 |
); |
| 446 |
|
| 447 |
$this->add_control( |
| 448 |
'list_color_layout_2', |
| 449 |
[ |
| 450 |
'label' => esc_html__( 'List Background Color', 'betterdocs' ), |
| 451 |
'type' => Controls_Manager::COLOR, |
| 452 |
'selectors' => [ |
| 453 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list' => 'background-color: {{VALUE}};' |
| 454 |
] |
| 455 |
] |
| 456 |
); |
| 457 |
|
| 458 |
$this->add_control( |
| 459 |
'list_hover_color_layout_2', |
| 460 |
[ |
| 461 |
'label' => esc_html__( 'List Background Hover Color', 'betterdocs' ), |
| 462 |
'type' => Controls_Manager::COLOR, |
| 463 |
'selectors' => [ |
| 464 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list:hover' => 'background-color: {{VALUE}};' |
| 465 |
] |
| 466 |
] |
| 467 |
); |
| 468 |
|
| 469 |
$this->add_responsive_control( |
| 470 |
'list_margin_layout_2', |
| 471 |
[ |
| 472 |
'label' => esc_html__( 'List Item Spacing', 'betterdocs' ), |
| 473 |
'type' => Controls_Manager::DIMENSIONS, |
| 474 |
'size_units' => [ 'px', 'em', '%' ], |
| 475 |
'selectors' => [ |
| 476 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 477 |
] |
| 478 |
] |
| 479 |
); |
| 480 |
|
| 481 |
$this->add_control( |
| 482 |
'list_icon_layout_2', |
| 483 |
[ |
| 484 |
'label' => esc_html__( 'List Icon', 'betterdocs' ), |
| 485 |
'type' => Controls_Manager::HEADING, |
| 486 |
'separator' => 'before' |
| 487 |
] |
| 488 |
); |
| 489 |
|
| 490 |
$this->add_responsive_control( |
| 491 |
'list_icon_layout_2_size', |
| 492 |
[ |
| 493 |
'label' => __( 'Size', 'betterdocs' ), |
| 494 |
'type' => Controls_Manager::SLIDER, |
| 495 |
'size_units' => [ 'px', '%', 'em' ], |
| 496 |
'range' => [ |
| 497 |
'%' => [ |
| 498 |
'max' => 100, |
| 499 |
'step' => 1 |
| 500 |
] |
| 501 |
], |
| 502 |
'selectors' => [ |
| 503 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .betterdocs-entry-title span' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};' |
| 504 |
] |
| 505 |
] |
| 506 |
); |
| 507 |
|
| 508 |
$this->add_control( |
| 509 |
'list_title_layout_2', |
| 510 |
[ |
| 511 |
'label' => esc_html__( 'List Title', 'betterdocs' ), |
| 512 |
'type' => Controls_Manager::HEADING, |
| 513 |
'separator' => 'before' |
| 514 |
] |
| 515 |
); |
| 516 |
|
| 517 |
$this->add_group_control( |
| 518 |
Group_Control_Typography::get_type(), |
| 519 |
[ |
| 520 |
'name' => 'list_title_typography_layout_2', |
| 521 |
'selector' => '{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .betterdocs-entry-title a' |
| 522 |
] |
| 523 |
); |
| 524 |
|
| 525 |
$this->add_control( |
| 526 |
'list_title_word_wrap_layout_2', |
| 527 |
[ |
| 528 |
'label' => __( 'Word Wrap', 'betterdocs' ), |
| 529 |
'type' => Controls_Manager::SELECT2, |
| 530 |
'multiple' => false, |
| 531 |
'options' => [ |
| 532 |
'normal' => 'normal', |
| 533 |
'break-word' => 'break-word', |
| 534 |
'initial' => 'initial', |
| 535 |
'inherit' => 'inherit' |
| 536 |
], |
| 537 |
'default' => 'normal', |
| 538 |
'selectors' => [ |
| 539 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .betterdocs-entry-title a' => 'word-wrap: {{VALUE}};' |
| 540 |
] |
| 541 |
] |
| 542 |
); |
| 543 |
|
| 544 |
$this->add_control( |
| 545 |
'list_title_color_layout_2', |
| 546 |
[ |
| 547 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 548 |
'type' => Controls_Manager::COLOR, |
| 549 |
'selectors' => [ |
| 550 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .betterdocs-entry-title a' => 'color: {{VALUE}};' |
| 551 |
] |
| 552 |
] |
| 553 |
); |
| 554 |
$this->add_control( |
| 555 |
'list_title_hover_color_layout_2', |
| 556 |
[ |
| 557 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 558 |
'type' => Controls_Manager::COLOR, |
| 559 |
'selectors' => [ |
| 560 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .betterdocs-entry-title a:hover' => 'color: {{VALUE}};' |
| 561 |
] |
| 562 |
] |
| 563 |
); |
| 564 |
|
| 565 |
$this->add_control( |
| 566 |
'list_excerpt_title', |
| 567 |
[ |
| 568 |
'label' => esc_html__( 'List Excerpt', 'betterdocs' ), |
| 569 |
'type' => Controls_Manager::HEADING, |
| 570 |
'separator' => 'before' |
| 571 |
] |
| 572 |
); |
| 573 |
|
| 574 |
$this->add_control( |
| 575 |
'list_excerpt_color', |
| 576 |
[ |
| 577 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 578 |
'type' => Controls_Manager::COLOR, |
| 579 |
'selectors' => [ |
| 580 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p' => 'color: {{VALUE}};' |
| 581 |
] |
| 582 |
] |
| 583 |
); |
| 584 |
|
| 585 |
$this->add_control( |
| 586 |
'list_excerpt_hover_color', |
| 587 |
[ |
| 588 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 589 |
'type' => Controls_Manager::COLOR, |
| 590 |
'selectors' => [ |
| 591 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p:hover' => 'color: {{VALUE}};' |
| 592 |
] |
| 593 |
] |
| 594 |
); |
| 595 |
|
| 596 |
$this->add_control( |
| 597 |
'list_excerpt_color_hover', |
| 598 |
[ |
| 599 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 600 |
'type' => Controls_Manager::COLOR, |
| 601 |
'selectors' => [ |
| 602 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p:hover' => 'color: {{VALUE}};' |
| 603 |
] |
| 604 |
] |
| 605 |
); |
| 606 |
|
| 607 |
$this->add_group_control( |
| 608 |
Group_Control_Typography::get_type(), |
| 609 |
[ |
| 610 |
'name' => 'list_excerpt_typography', |
| 611 |
'selector' => '{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p' |
| 612 |
] |
| 613 |
); |
| 614 |
|
| 615 |
$this->add_control( |
| 616 |
'list_excerpt_last_update_time_title', |
| 617 |
[ |
| 618 |
'label' => esc_html__( 'List Updated Time', 'betterdocs' ), |
| 619 |
'type' => Controls_Manager::HEADING, |
| 620 |
'separator' => 'before' |
| 621 |
] |
| 622 |
); |
| 623 |
|
| 624 |
$this->add_control( |
| 625 |
'list_excerpt_last_update_time_color', |
| 626 |
[ |
| 627 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 628 |
'type' => Controls_Manager::COLOR, |
| 629 |
'selectors' => [ |
| 630 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date' => 'color: {{VALUE}};' |
| 631 |
] |
| 632 |
] |
| 633 |
); |
| 634 |
|
| 635 |
$this->add_control( |
| 636 |
'list_excerpt_last_update_time_hover_color', |
| 637 |
[ |
| 638 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 639 |
'type' => Controls_Manager::COLOR, |
| 640 |
'selectors' => [ |
| 641 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date:hover' => 'color: {{VALUE}};' |
| 642 |
] |
| 643 |
] |
| 644 |
); |
| 645 |
|
| 646 |
$this->add_control( |
| 647 |
'list_excerpt_last_update_time_background_color', |
| 648 |
[ |
| 649 |
'label' => esc_html__( 'Background Color', 'betterdocs' ), |
| 650 |
'type' => Controls_Manager::COLOR, |
| 651 |
'selectors' => [ |
| 652 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date' => 'background-color: {{VALUE}};' |
| 653 |
] |
| 654 |
] |
| 655 |
); |
| 656 |
|
| 657 |
$this->add_control( |
| 658 |
'list_excerpt_last_update_time_background_color_hover', |
| 659 |
[ |
| 660 |
'label' => esc_html__( 'Background Hover Color', 'betterdocs' ), |
| 661 |
'type' => Controls_Manager::COLOR, |
| 662 |
'selectors' => [ |
| 663 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date:hover' => 'background-color: {{VALUE}};' |
| 664 |
] |
| 665 |
] |
| 666 |
); |
| 667 |
|
| 668 |
$this->add_group_control( |
| 669 |
Group_Control_Typography::get_type(), |
| 670 |
[ |
| 671 |
'name' => 'list_excerpt_last_update_time_typography', |
| 672 |
'selector' => '{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date' |
| 673 |
] |
| 674 |
); |
| 675 |
|
| 676 |
$this->end_controls_section(); # end of 'Column Settings' |
| 677 |
} |
| 678 |
|
| 679 |
public function pagination_controls() { |
| 680 |
$this->start_controls_section( |
| 681 |
'section_common_pagination', |
| 682 |
[ |
| 683 |
'label' => __( 'Pagination', 'betterdocs' ), |
| 684 |
'tab' => Controls_Manager::TAB_STYLE |
| 685 |
] |
| 686 |
); |
| 687 |
|
| 688 |
$this->add_responsive_control( |
| 689 |
'pagination_margin', |
| 690 |
[ |
| 691 |
'label' => __( 'Margin', 'betterdocs' ), |
| 692 |
'type' => Controls_Manager::DIMENSIONS, |
| 693 |
'size_units' => [ 'px', '%', 'em' ], |
| 694 |
'selectors' => [ |
| 695 |
'{{WRAPPER}} .betterdocs-pagination' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 696 |
] |
| 697 |
] |
| 698 |
); |
| 699 |
|
| 700 |
$this->add_responsive_control( |
| 701 |
'pagination_padding', |
| 702 |
[ |
| 703 |
'label' => __( 'Padding', 'betterdocs' ), |
| 704 |
'type' => Controls_Manager::DIMENSIONS, |
| 705 |
'size_units' => [ 'px', '%', 'em' ], |
| 706 |
'selectors' => [ |
| 707 |
'{{WRAPPER}} .betterdocs-pagination' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 708 |
] |
| 709 |
] |
| 710 |
); |
| 711 |
|
| 712 |
$this->add_responsive_control( |
| 713 |
'pagination_alignment', |
| 714 |
[ |
| 715 |
'label' => __( 'Pagination Alignment', 'betterdocs' ), |
| 716 |
'type' => Controls_Manager::CHOOSE, |
| 717 |
'options' => [ |
| 718 |
'start' => [ |
| 719 |
'title' => __( 'Left', 'betterdocs' ), |
| 720 |
'icon' => 'fa fa-align-left' |
| 721 |
], |
| 722 |
'center' => [ |
| 723 |
'title' => __( 'Center', 'betterdocs' ), |
| 724 |
'icon' => 'fa fa-align-center' |
| 725 |
], |
| 726 |
'end' => [ |
| 727 |
'title' => __( 'Right', 'betterdocs' ), |
| 728 |
'icon' => 'fa fa-align-right' |
| 729 |
] |
| 730 |
], |
| 731 |
'selectors' => [ |
| 732 |
'{{WRAPPER}} .betterdocs-pagination ul' => 'justify-content: {{VALUE}};' |
| 733 |
] |
| 734 |
] |
| 735 |
); |
| 736 |
|
| 737 |
$this->add_responsive_control( |
| 738 |
'pagination_height', |
| 739 |
[ |
| 740 |
'label' => __( 'Height', 'betterdocs' ), |
| 741 |
'type' => Controls_Manager::SLIDER, |
| 742 |
'size_units' => [ 'px', '%', 'em' ], |
| 743 |
'range' => [ |
| 744 |
'%' => [ |
| 745 |
'max' => 100, |
| 746 |
'step' => 1 |
| 747 |
] |
| 748 |
], |
| 749 |
'selectors' => [ |
| 750 |
'{{WRAPPER}} .betterdocs-pagination ul li a' => 'height: {{SIZE}}{{UNIT}};' |
| 751 |
] |
| 752 |
] |
| 753 |
); |
| 754 |
|
| 755 |
$this->add_responsive_control( |
| 756 |
'pagination_width', |
| 757 |
[ |
| 758 |
'label' => __( 'Width', 'betterdocs' ), |
| 759 |
'type' => Controls_Manager::SLIDER, |
| 760 |
'size_units' => [ 'px', '%', 'em' ], |
| 761 |
'range' => [ |
| 762 |
'%' => [ |
| 763 |
'max' => 100, |
| 764 |
'step' => 1 |
| 765 |
] |
| 766 |
], |
| 767 |
'selectors' => [ |
| 768 |
'{{WRAPPER}} .betterdocs-pagination ul li a' => 'width: {{SIZE}}{{UNIT}};' |
| 769 |
] |
| 770 |
] |
| 771 |
); |
| 772 |
|
| 773 |
$this->add_control( |
| 774 |
'pagination_background_color', |
| 775 |
[ |
| 776 |
'label' => esc_html__( 'Background Color', 'betterdocs' ), |
| 777 |
'type' => Controls_Manager::COLOR, |
| 778 |
'selectors' => [ |
| 779 |
'{{WRAPPER}} .betterdocs-pagination ul li a' => 'background-color: {{VALUE}};' |
| 780 |
] |
| 781 |
] |
| 782 |
); |
| 783 |
|
| 784 |
$this->add_control( |
| 785 |
'pagination_color', |
| 786 |
[ |
| 787 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 788 |
'type' => Controls_Manager::COLOR, |
| 789 |
'selectors' => [ |
| 790 |
'{{WRAPPER}} .betterdocs-pagination ul li a' => 'color: {{VALUE}};' |
| 791 |
] |
| 792 |
] |
| 793 |
); |
| 794 |
|
| 795 |
$this->add_control( |
| 796 |
'pagination_border_color', |
| 797 |
[ |
| 798 |
'label' => esc_html__( 'Active Border Color', 'betterdocs' ), |
| 799 |
'type' => Controls_Manager::COLOR, |
| 800 |
'selectors' => [ |
| 801 |
'{{WRAPPER}} .betterdocs-pagination ul li.active a' => 'border-color: {{VALUE}};' |
| 802 |
] |
| 803 |
] |
| 804 |
); |
| 805 |
|
| 806 |
$this->add_group_control( |
| 807 |
Group_Control_Typography::get_type(), |
| 808 |
[ |
| 809 |
'name' => 'pagination_typography', |
| 810 |
'selector' => '{{WRAPPER}} .betterdocs-pagination ul li a' |
| 811 |
] |
| 812 |
); |
| 813 |
|
| 814 |
$this->end_controls_section(); |
| 815 |
} |
| 816 |
|
| 817 |
public function subcat_list_settings() { |
| 818 |
/** |
| 819 |
* ---------------------------------------------------------- |
| 820 |
* Section: List Settinggs |
| 821 |
* ---------------------------------------------------------- |
| 822 |
*/ |
| 823 |
$this->start_controls_section( |
| 824 |
'section_list_title_layout_2', |
| 825 |
[ |
| 826 |
'label' => __( 'List Title', 'betterdocs' ), |
| 827 |
'tab' => Controls_Manager::TAB_STYLE, |
| 828 |
'condition' => [ |
| 829 |
'section_betterdocs_archive_list_layout' => [ 'layout-1' ] |
| 830 |
] |
| 831 |
] |
| 832 |
); |
| 833 |
|
| 834 |
$this->add_control( |
| 835 |
'subcat_color', |
| 836 |
[ |
| 837 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 838 |
'type' => Controls_Manager::COLOR, |
| 839 |
'default' => '#3f5876', |
| 840 |
'selectors' => [ |
| 841 |
'{{WRAPPER}} .betterdocs-articles-list li .betterdocs-nested-category-title > a' => 'color: {{VALUE}};' |
| 842 |
] |
| 843 |
] |
| 844 |
); |
| 845 |
|
| 846 |
$this->add_control( |
| 847 |
'subcat_hover_color', |
| 848 |
[ |
| 849 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 850 |
'type' => Controls_Manager::COLOR, |
| 851 |
'default' => '#3f5876', |
| 852 |
'selectors' => [ |
| 853 |
'{{WRAPPER}} .betterdocs-articles-list li .betterdocs-nested-category-title > a:hover' => 'color: {{VALUE}};' |
| 854 |
] |
| 855 |
] |
| 856 |
); |
| 857 |
|
| 858 |
$this->add_responsive_control( |
| 859 |
'subcat_font_size', |
| 860 |
[ |
| 861 |
'label' => __( 'Font Size', 'betterdocs' ), |
| 862 |
'type' => Controls_Manager::SLIDER, |
| 863 |
'size_units' => [ 'px', '%', 'em' ], |
| 864 |
'range' => [ |
| 865 |
'%' => [ |
| 866 |
'max' => 100, |
| 867 |
'step' => 1 |
| 868 |
] |
| 869 |
], |
| 870 |
'selectors' => [ |
| 871 |
'{{WRAPPER}} .betterdocs-articles-list li .betterdocs-nested-category-title > a' => 'font-size: {{SIZE}}{{UNIT}};' |
| 872 |
] |
| 873 |
] |
| 874 |
); |
| 875 |
|
| 876 |
$this->add_control( |
| 877 |
'subcat_icon_color', |
| 878 |
[ |
| 879 |
'label' => esc_html__( 'Icon Color', 'betterdocs' ), |
| 880 |
'type' => Controls_Manager::COLOR, |
| 881 |
'default' => '#3f5876', |
| 882 |
'selectors' => [ |
| 883 |
'{{WRAPPER}} .betterdocs-articles-list li .betterdocs-nested-category-title > svg.toggle-arrow' => 'fill: {{VALUE}};' |
| 884 |
] |
| 885 |
] |
| 886 |
); |
| 887 |
|
| 888 |
$this->add_responsive_control( |
| 889 |
'subcat_icon_size', |
| 890 |
[ |
| 891 |
'label' => __( 'Icon Size', 'betterdocs' ), |
| 892 |
'type' => Controls_Manager::SLIDER, |
| 893 |
'size_units' => [ 'px', '%', 'em' ], |
| 894 |
'range' => [ |
| 895 |
'%' => [ |
| 896 |
'max' => 100, |
| 897 |
'step' => 1 |
| 898 |
] |
| 899 |
], |
| 900 |
'selectors' => [ |
| 901 |
'{{WRAPPER}} .betterdocs-articles-list li .betterdocs-nested-category-title > svg.toggle-arrow' => 'font-size: {{SIZE}}{{UNIT}}; width: auto;' |
| 902 |
] |
| 903 |
] |
| 904 |
); |
| 905 |
|
| 906 |
$this->add_control( |
| 907 |
'subcategory_list_heading', |
| 908 |
[ |
| 909 |
'label' => esc_html__( 'Subcategory List', 'betterdocs' ), |
| 910 |
'type' => Controls_Manager::HEADING, |
| 911 |
'separator' => 'before' |
| 912 |
] |
| 913 |
); |
| 914 |
|
| 915 |
$this->add_group_control( |
| 916 |
Group_Control_Typography::get_type(), |
| 917 |
[ |
| 918 |
'name' => 'subcat_list_item_typography', |
| 919 |
'selector' => '{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-list li:not(.betterdocs-nested-category-wrapper) a' |
| 920 |
] |
| 921 |
); |
| 922 |
|
| 923 |
$this->add_control( |
| 924 |
'subcat_list_word_wrap', |
| 925 |
[ |
| 926 |
'label' => __( 'Word Wrap', 'betterdocs' ), |
| 927 |
'type' => Controls_Manager::SELECT2, |
| 928 |
'multiple' => false, |
| 929 |
'options' => [ |
| 930 |
'normal' => 'normal', |
| 931 |
'break-word' => 'break-word', |
| 932 |
'initial' => 'initial', |
| 933 |
'inherit' => 'inherit' |
| 934 |
], |
| 935 |
'default' => 'normal', |
| 936 |
'selectors' => [ |
| 937 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-list li:not(.betterdocs-nested-category-wrapper) a' => 'word-wrap: {{VALUE}};' |
| 938 |
] |
| 939 |
] |
| 940 |
); |
| 941 |
|
| 942 |
$this->add_control( |
| 943 |
'subcat_list_color', |
| 944 |
[ |
| 945 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 946 |
'type' => Controls_Manager::COLOR, |
| 947 |
'selectors' => [ |
| 948 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-list li:not(.betterdocs-nested-category-wrapper) a' => 'color: {{VALUE}};' |
| 949 |
] |
| 950 |
] |
| 951 |
); |
| 952 |
|
| 953 |
$this->add_control( |
| 954 |
'subcat_list_hover_color', |
| 955 |
[ |
| 956 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 957 |
'type' => Controls_Manager::COLOR, |
| 958 |
'selectors' => [ |
| 959 |
'{{WRAPPER}} .betterdocs-articles-list li:not(.betterdocs-nested-category-wrapper) a:hover' => 'color: {{VALUE}};' |
| 960 |
] |
| 961 |
] |
| 962 |
); |
| 963 |
|
| 964 |
$this->add_responsive_control( |
| 965 |
'subcat_list_margin', |
| 966 |
[ |
| 967 |
'label' => esc_html__( 'List Item Spacing', 'betterdocs' ), |
| 968 |
'type' => Controls_Manager::DIMENSIONS, |
| 969 |
'size_units' => [ 'px', 'em', '%' ], |
| 970 |
'selectors' => [ |
| 971 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-list li:not(.betterdocs-nested-category-wrapper)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 972 |
] |
| 973 |
] |
| 974 |
); |
| 975 |
|
| 976 |
$this->add_control( |
| 977 |
'subcat_icon_settings_heading', |
| 978 |
[ |
| 979 |
'label' => esc_html__( 'List Icon', 'betterdocs' ), |
| 980 |
'type' => Controls_Manager::HEADING, |
| 981 |
'separator' => 'before' |
| 982 |
] |
| 983 |
); |
| 984 |
|
| 985 |
$this->add_control( |
| 986 |
'subcat_list_icon_color', |
| 987 |
[ |
| 988 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 989 |
'type' => Controls_Manager::COLOR, |
| 990 |
'selectors' => [ |
| 991 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-list li svg:not(.toggle-arrow)' => 'fill: {{VALUE}};' |
| 992 |
] |
| 993 |
] |
| 994 |
); |
| 995 |
|
| 996 |
$this->add_responsive_control( |
| 997 |
'subcat_list_icon_size', |
| 998 |
[ |
| 999 |
'label' => __( 'Size', 'betterdocs' ), |
| 1000 |
'type' => Controls_Manager::SLIDER, |
| 1001 |
'size_units' => [ 'px', '%', 'em' ], |
| 1002 |
'range' => [ |
| 1003 |
'%' => [ |
| 1004 |
'max' => 100, |
| 1005 |
'step' => 1 |
| 1006 |
] |
| 1007 |
], |
| 1008 |
'selectors' => [ |
| 1009 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-list li svg:not(.toggle-arrow)' => 'width: {{SIZE}}{{UNIT}};' |
| 1010 |
] |
| 1011 |
] |
| 1012 |
); |
| 1013 |
|
| 1014 |
$this->add_responsive_control( |
| 1015 |
'subcat_list_icon_spacing', |
| 1016 |
[ |
| 1017 |
'label' => esc_html__( 'Spacing', 'betterdocs' ), |
| 1018 |
'type' => Controls_Manager::DIMENSIONS, |
| 1019 |
'size_units' => [ 'px', 'em', '%' ], |
| 1020 |
'selectors' => [ |
| 1021 |
'{{WRAPPER}} .betterdocs-articles-list .betterdocs-nested-category-list li svg:not(.toggle-arrow)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1022 |
] |
| 1023 |
] |
| 1024 |
); |
| 1025 |
|
| 1026 |
$this->end_controls_section(); # end of 'Column Settings' |
| 1027 |
} |
| 1028 |
|
| 1029 |
public function container_wrapper_section_layout_3() { |
| 1030 |
$this->start_controls_section( |
| 1031 |
'archive_list_container_section_layout_3', |
| 1032 |
[ |
| 1033 |
'label' => __( 'Container Section', 'betterdocs' ), |
| 1034 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1035 |
'condition' => [ |
| 1036 |
'section_betterdocs_archive_list_layout' => [ 'layout-3' ] |
| 1037 |
] |
| 1038 |
] |
| 1039 |
); |
| 1040 |
|
| 1041 |
$this->add_responsive_control( |
| 1042 |
'archive_list_container_padding_layout_3', |
| 1043 |
[ |
| 1044 |
'label' => __( 'Padding', 'betterdocs' ), |
| 1045 |
'type' => Controls_Manager::DIMENSIONS, |
| 1046 |
'size_units' => [ 'px', 'em', '%' ], |
| 1047 |
'selectors' => [ |
| 1048 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1049 |
] |
| 1050 |
] |
| 1051 |
); |
| 1052 |
|
| 1053 |
$this->add_responsive_control( |
| 1054 |
'archive_list_container_margin_layout_3', |
| 1055 |
[ |
| 1056 |
'label' => __( 'Margin', 'betterdocs' ), |
| 1057 |
'type' => Controls_Manager::DIMENSIONS, |
| 1058 |
'size_units' => [ 'px', 'em', '%' ], |
| 1059 |
'selectors' => [ |
| 1060 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1061 |
] |
| 1062 |
] |
| 1063 |
); |
| 1064 |
|
| 1065 |
$this->end_controls_section(); |
| 1066 |
} |
| 1067 |
|
| 1068 |
public function list_settings_layout_3() { |
| 1069 |
/** |
| 1070 |
* ---------------------------------------------------------- |
| 1071 |
* Section: List Settings Layout 3 |
| 1072 |
* ---------------------------------------------------------- |
| 1073 |
*/ |
| 1074 |
$this->start_controls_section( |
| 1075 |
'section_article_settings_layout_3', |
| 1076 |
[ |
| 1077 |
'label' => __( 'Category List', 'betterdocs' ), |
| 1078 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1079 |
'condition' => [ |
| 1080 |
'section_betterdocs_archive_list_layout' => [ 'layout-3' ] |
| 1081 |
] |
| 1082 |
] |
| 1083 |
); |
| 1084 |
|
| 1085 |
$this->add_control( |
| 1086 |
'list_color_layout_3', |
| 1087 |
[ |
| 1088 |
'label' => esc_html__( 'List Background Color', 'betterdocs' ), |
| 1089 |
'type' => Controls_Manager::COLOR, |
| 1090 |
'selectors' => [ |
| 1091 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list' => 'background-color: {{VALUE}};' |
| 1092 |
] |
| 1093 |
] |
| 1094 |
); |
| 1095 |
|
| 1096 |
$this->add_control( |
| 1097 |
'list_hover_color_layout_3', |
| 1098 |
[ |
| 1099 |
'label' => esc_html__( 'List Background Color Hover', 'betterdocs' ), |
| 1100 |
'type' => Controls_Manager::COLOR, |
| 1101 |
'default' => '#f6fef9', |
| 1102 |
'selectors' => [ |
| 1103 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list:hover' => 'background-color: {{VALUE}};' |
| 1104 |
] |
| 1105 |
] |
| 1106 |
); |
| 1107 |
|
| 1108 |
$this->add_responsive_control( |
| 1109 |
'list_margin_layout_3', |
| 1110 |
[ |
| 1111 |
'label' => esc_html__( 'List Item Spacing', 'betterdocs' ), |
| 1112 |
'type' => Controls_Manager::DIMENSIONS, |
| 1113 |
'size_units' => [ 'px', 'em', '%' ], |
| 1114 |
'selectors' => [ |
| 1115 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1116 |
] |
| 1117 |
] |
| 1118 |
); |
| 1119 |
|
| 1120 |
$this->add_responsive_control( |
| 1121 |
'list_padding_layout_3', |
| 1122 |
[ |
| 1123 |
'label' => esc_html__( 'List Area Padding', 'betterdocs' ), |
| 1124 |
'type' => Controls_Manager::DIMENSIONS, |
| 1125 |
'allowed_dimensions' => 'vertical', |
| 1126 |
'size_units' => [ 'px', 'em', '%' ], |
| 1127 |
'selectors' => [ |
| 1128 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list' => 'padding-top: {{TOP}}{{UNIT}}; padding-bottom: {{BOTTOM}}{{UNIT}};' |
| 1129 |
] |
| 1130 |
] |
| 1131 |
); |
| 1132 |
|
| 1133 |
$this->add_control( |
| 1134 |
'list_title_layout_3', |
| 1135 |
[ |
| 1136 |
'label' => esc_html__( 'List Title', 'betterdocs' ), |
| 1137 |
'type' => Controls_Manager::HEADING, |
| 1138 |
'separator' => 'before' |
| 1139 |
] |
| 1140 |
); |
| 1141 |
|
| 1142 |
$this->add_control( |
| 1143 |
'list_title_color_layout_3', |
| 1144 |
[ |
| 1145 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 1146 |
'type' => Controls_Manager::COLOR, |
| 1147 |
'selectors' => [ |
| 1148 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list h2 a' => 'color: {{VALUE}};' |
| 1149 |
] |
| 1150 |
] |
| 1151 |
); |
| 1152 |
|
| 1153 |
$this->add_control( |
| 1154 |
'list_title_hover_color_layout_3', |
| 1155 |
[ |
| 1156 |
'label' => esc_html__( 'Hover Color', 'betterdocs' ), |
| 1157 |
'type' => Controls_Manager::COLOR, |
| 1158 |
'selectors' => [ |
| 1159 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list h2 a:hover' => 'color: {{VALUE}};' |
| 1160 |
] |
| 1161 |
] |
| 1162 |
); |
| 1163 |
|
| 1164 |
$this->add_group_control( |
| 1165 |
Group_Control_Typography::get_type(), |
| 1166 |
[ |
| 1167 |
'name' => 'list_title_typography_layout_3', |
| 1168 |
'selector' => '{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list h2' |
| 1169 |
] |
| 1170 |
); |
| 1171 |
|
| 1172 |
$this->add_responsive_control( |
| 1173 |
'list_title_margin_layout_3', |
| 1174 |
[ |
| 1175 |
'label' => esc_html__( 'Title Margin', 'betterdocs' ), |
| 1176 |
'type' => Controls_Manager::DIMENSIONS, |
| 1177 |
'size_units' => [ 'px', 'em', '%' ], |
| 1178 |
'selectors' => [ |
| 1179 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list h2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1180 |
] |
| 1181 |
] |
| 1182 |
); |
| 1183 |
|
| 1184 |
$this->add_responsive_control( |
| 1185 |
'list_title_padding_layout_3', |
| 1186 |
[ |
| 1187 |
'label' => esc_html__( 'Title Padding', 'betterdocs' ), |
| 1188 |
'type' => Controls_Manager::DIMENSIONS, |
| 1189 |
'size_units' => [ 'px', 'em', '%' ], |
| 1190 |
'selectors' => [ |
| 1191 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list h2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1192 |
] |
| 1193 |
] |
| 1194 |
); |
| 1195 |
|
| 1196 |
$this->add_control( |
| 1197 |
'list_excerpt_layout_3', |
| 1198 |
[ |
| 1199 |
'label' => esc_html__( 'List Excerpt', 'betterdocs' ), |
| 1200 |
'type' => Controls_Manager::HEADING, |
| 1201 |
'separator' => 'before' |
| 1202 |
] |
| 1203 |
); |
| 1204 |
|
| 1205 |
$this->add_control( |
| 1206 |
'list_excerpt_color_layout_3', |
| 1207 |
[ |
| 1208 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 1209 |
'type' => Controls_Manager::COLOR, |
| 1210 |
'selectors' => [ |
| 1211 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p' => 'color: {{VALUE}};' |
| 1212 |
] |
| 1213 |
] |
| 1214 |
); |
| 1215 |
|
| 1216 |
$this->add_group_control( |
| 1217 |
Group_Control_Typography::get_type(), |
| 1218 |
[ |
| 1219 |
'name' => 'list_excerpt_typography_layout_3', |
| 1220 |
'selector' => '{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p' |
| 1221 |
] |
| 1222 |
); |
| 1223 |
|
| 1224 |
$this->add_responsive_control( |
| 1225 |
'list_excerpt_margin_layout_3', |
| 1226 |
[ |
| 1227 |
'label' => esc_html__( 'Excerpt Margin', 'betterdocs' ), |
| 1228 |
'type' => Controls_Manager::DIMENSIONS, |
| 1229 |
'size_units' => [ 'px', 'em', '%' ], |
| 1230 |
'selectors' => [ |
| 1231 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1232 |
] |
| 1233 |
] |
| 1234 |
); |
| 1235 |
|
| 1236 |
$this->add_responsive_control( |
| 1237 |
'list_excerpt_padding_layout_3', |
| 1238 |
[ |
| 1239 |
'label' => esc_html__( 'Excerpt Padding', 'betterdocs' ), |
| 1240 |
'type' => Controls_Manager::DIMENSIONS, |
| 1241 |
'size_units' => [ 'px', 'em', '%' ], |
| 1242 |
'selectors' => [ |
| 1243 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1244 |
] |
| 1245 |
] |
| 1246 |
); |
| 1247 |
|
| 1248 |
$this->add_control( |
| 1249 |
'list_date_layout_3', |
| 1250 |
[ |
| 1251 |
'label' => esc_html__( 'Last Updated Date', 'betterdocs' ), |
| 1252 |
'type' => Controls_Manager::HEADING, |
| 1253 |
'separator' => 'before' |
| 1254 |
] |
| 1255 |
); |
| 1256 |
|
| 1257 |
$this->add_control( |
| 1258 |
'list_date_color_layout_3', |
| 1259 |
[ |
| 1260 |
'label' => esc_html__( 'Color', 'betterdocs' ), |
| 1261 |
'type' => Controls_Manager::COLOR, |
| 1262 |
'selectors' => [ |
| 1263 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date' => 'color: {{VALUE}};' |
| 1264 |
] |
| 1265 |
] |
| 1266 |
); |
| 1267 |
|
| 1268 |
$this->add_group_control( |
| 1269 |
Group_Control_Typography::get_type(), |
| 1270 |
[ |
| 1271 |
'name' => 'list_date_typography_layout_3', |
| 1272 |
'selector' => '{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date' |
| 1273 |
] |
| 1274 |
); |
| 1275 |
|
| 1276 |
$this->add_responsive_control( |
| 1277 |
'list_date_margin_layout_3', |
| 1278 |
[ |
| 1279 |
'label' => esc_html__( 'Date Margin', 'betterdocs' ), |
| 1280 |
'type' => Controls_Manager::DIMENSIONS, |
| 1281 |
'size_units' => [ 'px', 'em', '%' ], |
| 1282 |
'selectors' => [ |
| 1283 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1284 |
] |
| 1285 |
] |
| 1286 |
); |
| 1287 |
|
| 1288 |
$this->add_responsive_control( |
| 1289 |
'list_date_padding_layout_3', |
| 1290 |
[ |
| 1291 |
'label' => esc_html__( 'Date Padding', 'betterdocs' ), |
| 1292 |
'type' => Controls_Manager::DIMENSIONS, |
| 1293 |
'size_units' => [ 'px', 'em', '%' ], |
| 1294 |
'selectors' => [ |
| 1295 |
'{{WRAPPER}} .betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1296 |
] |
| 1297 |
] |
| 1298 |
); |
| 1299 |
|
| 1300 |
$this->end_controls_section(); |
| 1301 |
} |
| 1302 |
|
| 1303 |
public function reset_attributes() { |
| 1304 |
$this->attributes['orderby'] = $this->attributes['alphabetic_order']; |
| 1305 |
$this->attributes['post_orderby'] = $this->attributes['alphabetic_order']; |
| 1306 |
$this->attributes['post_order'] = $this->attributes['order']; |
| 1307 |
} |
| 1308 |
|
| 1309 |
protected function render_callback() { |
| 1310 |
$this->views( 'widgets/archive-list' ); |
| 1311 |
} |
| 1312 |
|
| 1313 |
public function view_params() { |
| 1314 |
global $wp_query; |
| 1315 |
|
| 1316 |
$_term_slug = ''; |
| 1317 |
if ( isset( $wp_query->query ) && array_key_exists( 'doc_category', $wp_query->query ) ) { |
| 1318 |
$_term_slug = $wp_query->query['doc_category']; |
| 1319 |
} |
| 1320 |
|
| 1321 |
$term = get_term_by( 'slug', $_term_slug, 'doc_category' ); |
| 1322 |
|
| 1323 |
// Fix orderby mapping for proper sorting |
| 1324 |
$orderby = $this->attributes['alphabetic_order']; |
| 1325 |
if ( $orderby == 'slug' ) { |
| 1326 |
$orderby = 'name'; |
| 1327 |
} else { |
| 1328 |
$orderby = $this->attributes['alphabetic_order']; |
| 1329 |
} |
| 1330 |
|
| 1331 |
|
| 1332 |
$_docs_query = [ |
| 1333 |
'term_id' => isset( $term->term_id ) ? $term->term_id : 0, |
| 1334 |
'orderby' => $orderby, |
| 1335 |
'order' => $this->attributes['order'], |
| 1336 |
'postsOrderBy' => $orderby, |
| 1337 |
'postsOrder' => $this->attributes['order'], |
| 1338 |
'kb_slug' => '', |
| 1339 |
'posts_per_page' => $term == false ? 5 : -1, |
| 1340 |
'term_slug' => isset( $term->slug ) ? $term->slug : '' |
| 1341 |
]; |
| 1342 |
|
| 1343 |
$term_params = [ |
| 1344 |
'term' => $term, |
| 1345 |
'list_icon_url' => '', |
| 1346 |
'nested_subcategory' => (bool) $this->attributes['nested_subcategory'], |
| 1347 |
'list_icon_name' => $this->attributes['list_icon'], |
| 1348 |
'query_args' => betterdocs()->query->docs_query_args( $_docs_query ), |
| 1349 |
'nested_docs_query_args' => [ |
| 1350 |
'orderby' => $orderby, |
| 1351 |
'order' => $this->attributes['order'] |
| 1352 |
], |
| 1353 |
'nested_terms_query' => [ |
| 1354 |
'orderby' => $orderby, |
| 1355 |
'order' => $this->attributes['order'] |
| 1356 |
], |
| 1357 |
'layout_type' => 'widget', |
| 1358 |
'archive_layout' => $this->attributes['section_betterdocs_archive_list_layout'] |
| 1359 |
]; |
| 1360 |
|
| 1361 |
if ( $this->attributes['section_betterdocs_archive_list_layout'] == 'layout-2' || $this->attributes['section_betterdocs_archive_list_layout'] == 'layout-3' ) { |
| 1362 |
$docs_list_title_tag = $this->attributes['list_title_tag_layout_2']; |
| 1363 |
|
| 1364 |
// Extend the base params rather than replacing them, so the nesting |
| 1365 |
// keys built above (nested_subcategory, nested_terms_query, |
| 1366 |
// nested_docs_query_args, list_icon_name, list_icon_url, layout_type) |
| 1367 |
// survive for Layout 2/3 and their templates can render nested |
| 1368 |
// subcategories the way Layout 1 does. Previously this branch |
| 1369 |
// overwrote $term_params wholesale, dropping every nesting key. |
| 1370 |
$term_params['current_category'] = $term; |
| 1371 |
$term_params['orderby'] = $orderby; |
| 1372 |
$term_params['order'] = $this->attributes['order']; |
| 1373 |
$term_params['posts_per_page'] = -1; |
| 1374 |
$term_params['docs_list_title_tag'] = $docs_list_title_tag; |
| 1375 |
} |
| 1376 |
|
| 1377 |
if ( $this->attributes['enable_pagination'] ) { //pass page variable in query args if pagination is enabled |
| 1378 |
$page = get_query_var( 'paged' ) != '' ? get_query_var( 'paged' ) : 1; |
| 1379 |
$posts_per_page = isset( $this->attributes['posts_per_page'] ) ? $this->attributes['posts_per_page'] : 10; |
| 1380 |
|
| 1381 |
$term_params['query_args']['paged'] = $page; |
| 1382 |
$term_params['query_args']['posts_per_page'] = $posts_per_page; |
| 1383 |
$term_params['page'] = $page; |
| 1384 |
$term_params['posts_per_page'] = $posts_per_page; |
| 1385 |
$term_params['pagination'] = $this->attributes['enable_pagination']; |
| 1386 |
} |
| 1387 |
|
| 1388 |
$term_params['edit_mode'] = ElementorPlugin::instance()->editor->is_edit_mode(); |
| 1389 |
|
| 1390 |
return $term_params; |
| 1391 |
} |
| 1392 |
|
| 1393 |
public function render_plain_content() {} |
| 1394 |
} |
| 1395 |
|