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',
              ),
            ),
)
)

) );

したがって、子コンテナ内の「assign_filter」を設定するために、親パラメータ「add_custom_filters」に値を入力する必要があります。

ありがとう。

4

0 に答える 0