Hi,
I want to create plugin for shortcode, i'm trying first jquery toggle.
I built component "toggle":
public function componentDetails()
{
return [
'name' => 'toggle',
'description' => 'jquery toggle implementation'
];
}
public function defineProperties()
{
return [
'title' => [
'description' => 'The title of toggle',
'title' => 'Title',
'type' => 'string',
],
'content' => [
'description' => 'The content of toggle',
'title' => 'Content',
'type' => 'string',
]
];
}
public function toggles(){
return [
'1' => [
'title' => $this->property('title'),
'content' => $this->property('content')]
];
}
The default.htm is:
{% set toggles = __SELF__.toggles %}
div class="toggles">
{% for toggles in toggles %}
div class="toggle">
div class="toggle-title">{{ toggles.title }} /div>
div class="toggle-content">{{ toggles.content }} /div>
/div>
{% endfor %}
/div>
I'm looking for a way to pass an array of content and title and not only one toggle in a component.
Last updated