Elementorのカスタムモジュールでリピーターを作成しているのですが、リピーターアイテムごとに既存のテンプレートを選択してレンダリングできるようにしたいです。Elementorコントロールでテンプレート選択を実装し、フロントエンドで選択に基づいて適切なテンプレートをレンダリングするにはどうすればよいでしょうか?
start_controls_section(
'section_content', [
[
'label' => esc_html__('Content', 'textdomain'), [
'tab' => \ElementorControls_Manager::TAB_CONTENT、
]
);
$this->add_control(
'store_settings'.
[
'label' => esc_html__('店舗設定', 'textdomain')、
'type' => \ElementorControls_Manager::REPEATER、
'fields' => [
[
'name' => 'title_section', 'label' => [
'label' => __('セクションのタイトル', 'custom-store'), \ElementorControls_Manager::REPEATER
'default' => __('デフォルトタイトル', 'custom-store'), .
]
]
]
);
$this->end_controls_section();
}
protected function render()
{
$settings = $this->get_settings();
$args = [];
show_template('template', $args, str_replace(get_stylesheet_directory() . directory_separator, '', __dir__));;
}
}

| お問い合わせ | |
|---|---|
| チュートリアルが読めない?無料でお答えします!個人サイト、中小企業サイトのための無料ヘルプ! |
カスタマーサービス WeChat
|
| ① 電話:020-2206-9892 | |
| ② QQ咨询:1025174874 | |
| 三 Eメール:info@361sale.com | |
| ④ 勤務時間: 月~金、9:30~18:30、祝日休み | |



- 最新
- ホット
著者のみご覧ください。