shortcode-vc-section.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. return array(
  6. 'name' => esc_html__( 'Section', 'js_composer' ),
  7. 'is_container' => true,
  8. 'icon' => 'vc_icon-vc-section',
  9. 'show_settings_on_create' => false,
  10. 'category' => esc_html__( 'Content', 'js_composer' ),
  11. 'as_parent' => array(
  12. 'only' => 'vc_row',
  13. ),
  14. 'as_child' => array(
  15. 'only' => '', // Only root
  16. ),
  17. 'class' => 'vc_main-sortable-element',
  18. 'description' => esc_html__( 'Group multiple rows in section', 'js_composer' ),
  19. 'params' => array(
  20. array(
  21. 'type' => 'dropdown',
  22. 'heading' => esc_html__( 'Section stretch', 'js_composer' ),
  23. 'param_name' => 'full_width',
  24. 'value' => array(
  25. esc_html__( 'Default', 'js_composer' ) => '',
  26. esc_html__( 'Stretch section', 'js_composer' ) => 'stretch_row',
  27. esc_html__( 'Stretch section and content', 'js_composer' ) => 'stretch_row_content',
  28. ),
  29. 'description' => esc_html__( 'Select stretching options for section and content (Note: stretched may not work properly if parent container has "overflow: hidden" CSS property).', 'js_composer' ),
  30. ),
  31. array(
  32. 'type' => 'checkbox',
  33. 'heading' => esc_html__( 'Full height section?', 'js_composer' ),
  34. 'param_name' => 'full_height',
  35. 'description' => esc_html__( 'If checked section will be set to full height.', 'js_composer' ),
  36. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  37. ),
  38. array(
  39. 'type' => 'dropdown',
  40. 'heading' => esc_html__( 'Content position', 'js_composer' ),
  41. 'param_name' => 'content_placement',
  42. 'value' => array(
  43. esc_html__( 'Default', 'js_composer' ) => '',
  44. esc_html__( 'Top', 'js_composer' ) => 'top',
  45. esc_html__( 'Middle', 'js_composer' ) => 'middle',
  46. esc_html__( 'Bottom', 'js_composer' ) => 'bottom',
  47. ),
  48. 'description' => esc_html__( 'Select content position within section.', 'js_composer' ),
  49. ),
  50. array(
  51. 'type' => 'checkbox',
  52. 'heading' => esc_html__( 'Use video background?', 'js_composer' ),
  53. 'param_name' => 'video_bg',
  54. 'description' => esc_html__( 'If checked, video will be used as section background.', 'js_composer' ),
  55. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  56. ),
  57. array(
  58. 'type' => 'textfield',
  59. 'heading' => esc_html__( 'YouTube link', 'js_composer' ),
  60. 'param_name' => 'video_bg_url',
  61. 'value' => 'https://www.youtube.com/watch?v=lMJXxhRFO1k',
  62. // default video url
  63. 'description' => esc_html__( 'Add YouTube link.', 'js_composer' ),
  64. 'dependency' => array(
  65. 'element' => 'video_bg',
  66. 'not_empty' => true,
  67. ),
  68. ),
  69. array(
  70. 'type' => 'dropdown',
  71. 'heading' => esc_html__( 'Parallax', 'js_composer' ),
  72. 'param_name' => 'video_bg_parallax',
  73. 'value' => array(
  74. esc_html__( 'None', 'js_composer' ) => '',
  75. esc_html__( 'Simple', 'js_composer' ) => 'content-moving',
  76. esc_html__( 'With fade', 'js_composer' ) => 'content-moving-fade',
  77. ),
  78. 'description' => esc_html__( 'Add parallax type background for section.', 'js_composer' ),
  79. 'dependency' => array(
  80. 'element' => 'video_bg',
  81. 'not_empty' => true,
  82. ),
  83. ),
  84. array(
  85. 'type' => 'dropdown',
  86. 'heading' => esc_html__( 'Parallax', 'js_composer' ),
  87. 'param_name' => 'parallax',
  88. 'value' => array(
  89. esc_html__( 'None', 'js_composer' ) => '',
  90. esc_html__( 'Simple', 'js_composer' ) => 'content-moving',
  91. esc_html__( 'With fade', 'js_composer' ) => 'content-moving-fade',
  92. ),
  93. 'description' => esc_html__( 'Add parallax type background for section (Note: If no image is specified, parallax will use background image from Design Options).', 'js_composer' ),
  94. 'dependency' => array(
  95. 'element' => 'video_bg',
  96. 'is_empty' => true,
  97. ),
  98. ),
  99. array(
  100. 'type' => 'attach_image',
  101. 'heading' => esc_html__( 'Image', 'js_composer' ),
  102. 'param_name' => 'parallax_image',
  103. 'value' => '',
  104. 'description' => esc_html__( 'Select image from media library.', 'js_composer' ),
  105. 'dependency' => array(
  106. 'element' => 'parallax',
  107. 'not_empty' => true,
  108. ),
  109. ),
  110. array(
  111. 'type' => 'textfield',
  112. 'heading' => esc_html__( 'Parallax speed', 'js_composer' ),
  113. 'param_name' => 'parallax_speed_video',
  114. 'value' => '1.5',
  115. 'description' => esc_html__( 'Enter parallax speed ratio (Note: Default value is 1.5, min value is 1)', 'js_composer' ),
  116. 'dependency' => array(
  117. 'element' => 'video_bg_parallax',
  118. 'not_empty' => true,
  119. ),
  120. ),
  121. array(
  122. 'type' => 'textfield',
  123. 'heading' => esc_html__( 'Parallax speed', 'js_composer' ),
  124. 'param_name' => 'parallax_speed_bg',
  125. 'value' => '1.5',
  126. 'description' => esc_html__( 'Enter parallax speed ratio (Note: Default value is 1.5, min value is 1)', 'js_composer' ),
  127. 'dependency' => array(
  128. 'element' => 'parallax',
  129. 'not_empty' => true,
  130. ),
  131. ),
  132. vc_map_add_css_animation( false ),
  133. array(
  134. 'type' => 'el_id',
  135. 'heading' => esc_html__( 'Section ID', 'js_composer' ),
  136. 'param_name' => 'el_id',
  137. 'description' => sprintf( esc_html__( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'js_composer' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ),
  138. ),
  139. array(
  140. 'type' => 'checkbox',
  141. 'heading' => esc_html__( 'Disable section', 'js_composer' ),
  142. 'param_name' => 'disable_element',
  143. // Inner param name.
  144. 'description' => esc_html__( 'If checked the section won\'t be visible on the public side of your website. You can switch it back any time.', 'js_composer' ),
  145. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  146. ),
  147. array(
  148. 'type' => 'textfield',
  149. 'heading' => esc_html__( 'Extra class name', 'js_composer' ),
  150. 'param_name' => 'el_class',
  151. 'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
  152. ),
  153. array(
  154. 'type' => 'css_editor',
  155. 'heading' => esc_html__( 'CSS box', 'js_composer' ),
  156. 'param_name' => 'css',
  157. 'group' => esc_html__( 'Design Options', 'js_composer' ),
  158. ),
  159. ),
  160. 'js_view' => 'VcSectionView',
  161. );