Simple example of using Collapse-Commander with sub-elements:
[expand cid="3279" /]
Since 1.3.3 we can use order and orderby attributes
[expand cid="3279" orderby="title" order="ASC" /]
A Pluginoven Test Site
Simple example of using Collapse-Commander with sub-elements:
[expand cid="3279" /]
Since 1.3.3 we can use order and orderby attributes
[expand cid="3279" orderby="title" order="ASC" /]
This is a test of the Collapse Commander templating system in use with the free Collapse-O-Matic plugin:
The above collapse element should expand above the trigger.
this is a test expand
We have already demonstrated how the new animation_effect and duration attributes work with a shortcode. Now we will show the same example but using the roll-your-own method. As always, the default effect is slideFade and duration is fast, but these can be overwritten globally in the plugin settings. As of version 1.7.3 these attributes can be applied on a collapse element basis using two new data-atributes: data-effect and data-duration.
<div class="collapseomatic" id="monkey" title="Monkeys">Monkeys</div>
<div id="target-monkey" class="collapseomatic_content">....</div>
<div class="collapseomatic" id="donkey" data-duration="slow" title="Donkeys">Donkeys</div>
<div id="target-donkey" class="collapseomatic_content">....</div>
<div class="collapseomatic" id="ninja" data-duration="1" data-animation_effect="slideToggle" title="Ninjas">Ninjas</div>
<div id="target-ninja" class="collapseomatic_content">....</div>
As of Collapse-O-Matic version 1.7.2 and Collapse-Pro-Matic version 1.3.2 we have added the ability to force one element to stay open in a highlander grouping. Simply add the class must-be-one
to all the triggers in a highlander group using the trigclass attribute like so:
[expand title="Monkeys" rel="animal-highlander" trigclass="must-be-one"]...[/expand]
[expand title="Donkeys" rel="animal-highlander" trigclass="must-be-one"]...[/expand]
[expand title="Ninjas" rel="animal-highlander" trigclass="must-be-one"]...[/expand]
The roll-your-own method has already been documented, however, what if you wanted to create your own sroll-to targets for each element? How can we do this with roll-your-own?
First we create an example using the shortcode:
[expand title="trigger text" findme="auto"]hidden content[/expand]
<div class="collapseomatic find-me" id="my_example" title="trigger text" data-offset="-60" data-findme="auto">trigger text</div>
The Target
<div id="target-my_example" class="collapseomatic_content ">Target Content</div>
[expand cid="2361" /]
[expand_trig cid="2361" /]
[expand_targ cid="2361" /]
This is a collapse commander element with no added metadata. Only Title and Content:
This is an example with NO trigger text assigned:
This is an example with sub items…
Using the expand shortcode we can create a simple collapse-o-matic accordion element like so:
[expand title="Trigger Text"]Target Content[/expand]
Now, if we wanted to do the same thing but using the roll-your-own method we would have to create the elements manually:
<div class="collapseomatic " id="my_id" title="Trigger Text">Trigger Text</div>
<div id="target-my_id" class="collapseomatic_content ">Target Content</div>
Now, we have the freedom to put the target element whatever we want: before, in or after the Trigger element. For example, here a link has been placed between the target and trigger:
<div class="collapseomatic" id="my_new_id" title="Trigger Text">Trigger Text</div>
<a href="http://plugins.twinpictures.de/premium-plugins/collapse-pro-matic/">Special Link</a>
<div id="target-my_new_id" class="collapseomatic_content ">Target Content</div>
Now if we apply a bit of CSS magic, we can have the trigger and link display inline:
Place the following css in the collapse-o-matic (or collapse-pro-matic) plugin options page, under Custom Style:
.magic_beans {
display: inline;
float: left;
margin-right: 1.2em;
}
.clear {
clear: both;
}
<div class="collapseomatic magic_beans" id="my_unique_id" title="Trigger Text">Trigger Text</div><a href="http://plugins.twinpictures.de/premium-plugins/collapse-pro-matic/" class="magic_beans">Collapse-Pro-Matic</a>
<div id="target-my_unique_id" class="collapseomatic_content clear">Target Content</div>
<img src="https://spacedonkey.de/wp-content/uploads/2016/01/2001_Space_Odysey-300x145.gif" class="collapseomatic noarrow" id="some_id" title="Hover over Trigger Text">
<div class="collapseomatic_content" id="target-some_id" >Target Content</div>
Highlander grouping is accomplished by adding data-group=”group_name-highlander” like so:
<div class="collapseomatic" id="monkey" data-group="animal-highlander" title="Monkeys">Monkeys</div>
<div id="target-monkey" class="collapseomatic_content">The monkey says Eek! Eek!</div>
<div class="collapseomatic" id="donkey" data-group="animal-highlander" title="Donkeys">Donkeys</div>
<div id="target-donkey" class="collapseomatic_content">The Donkey says Hee Haw</div>