2

我使用“as_parent”和“as_child”参数创建了一些具有父属性和子属性的 Visual Composer 元素。我在父容器中添加了一些字段,在子容器中添加了一些字段。我需要的是根据父元素字段中的值填充子元素的参数值。有什么我可以遵循的方法来完成它。

这是我的代码 vc_map(array(

    "name" => __("Image Gallery", "textdomain"),
    "base" => "test_image_gallery",
    "as_parent" => array('only' => 'test_gal_single_element, test_gal_cat_element'),
    "content_element" => true,
    "show_settings_on_create" => false,
    "is_container" => true,
    "params" => array(

        array(
            "type" => "textfield",
            "heading" => __("Add Filters", "textdomain"),
            "description" => __( "Enter filters separated by commas. eg: filter1, filter2 etc", "textdomain" ),
            "param_name" => "add_custom_filters",
            'dependency' => array(
                'element' => 'show_filter',
                'value' => 'true',
            ),
        ),

    ),
    "js_view" => 'VcColumnView'
    ) );


vc_map( array(
    "name" => __("Idea", "textdomain"),
    "base" => "test_gal_single_element",
    "content_element" => true,
    "as_child" => array('only' => 'test_image_gallery'),
    "params" => array(
array(
            "type" => "checkbox",
            "heading" => __("Assign Filter", "textdomain"),
            "param_name" => "assign_filter",
            "value"       => array(
                'Wool'   => 'Wool',
                'Synthetic'   => 'Synthetic',
              ),
            ),
)
)

));

所以我需要在父参数“add_custom_filters”中输入值,以填充子容器内的“assign_filter” 。

谢谢。

4

0 回答 0