Collapse O Matic and Using HTML Inside a Shortcode Attribute

Here is an example of using html inside a shortcode attribute:

[expand title='HTML Title']Here is some content[/expand]

HTML Title
Here is some content

As of 1.8.4 this will no longer work. Instead we need to use the tag attribute:
[expand tag='span' title='Non HTML Title']Here is some content[/expand]
Non HTML Title

Here is some content

Here is a test also using HTML in the swaptitle attribugte
[expand title='HTML Title' swaptitle='Hey Dude']Here is some content[/expand]

HTML Title
Here is some content
Title
Here is some content

Collapse-O-Matic Button

[expand title="Push me" swaptitle="Push" trigclass="noarrow my_button" tag="div"]this is the hidden content[/expand]
Push me
this is the hidden content

CSS

.my_button {
background-color: white;
color: black;
border-radius: 6px;
font-family: by;
padding: 5px;
width: 99px;
text-align: center;
border: 2px solid #98FB98; /* Green */
}

.my_button.colomat-hover{
background-color: #eb234c; /* red */
color: white;
text-align: center;
}

Collapse-O-Matic Nested Grouping

This is a test of nesting grouping. First, nested highlander grouping:

[expand title="This" rel="main-highlander"]
[expandsub1 title="This One" rel="this-highlander"]One[/expandsub1]
[expandsub1 title="This Two" rel="this-highlander"]Two[/expandsub1]
[expandsub1 title="This Three" rel="this-highlander"]Three[/expandsub1]
[/expand]

[expand title="That" rel="main-highlander"]
[expandsub1 title="That One" rel="that-highlander"]One[/expandsub1]
[expandsub1 title="That Two" rel="that-highlander"]Two[/expandsub1]
[expandsub1 title="that Three" rel="that-highlander"]Three[/expandsub1]
[/expand]
This
This One
One
This Two
Two
This Three
Three
That
That One
One
That Two
Two
that Three
Three

Grouping with Rel vs Togglegroup Attbitues

Rel Attribute

Here is an example of using the rel attribute. Notice how selecting a member of one group will auto-collapse members of all other groups.

[expand title="Star Wars" rel="fiction" swaptitle="Not Star Trek"]Target Content[/expand]
[expand title="Star Trek" rel="fiction"]Target Content[/expand]
[expand title="Battlestar Galactica" rel="fiction"]Target Content[/expand]
[expand title="Space Race" rel="history"]Target Content[/expand]
[expand title="Ansari X Prize" rel="history"]Target Content[/expand]
Star Wars
Target Content
Star Trek
Target Content
Battlestar Galactica
Target Content
Space Race
Target Content
Ansari X Prize
Target Content

Togglegroup Attribute

Here is an example using the togglegroup attribute. Members of multiple togglegroups may be open at the same time.

[expand title="Star Wars" togglegroup="togfiction"]Target Content[/expand]
[expand title="Star Trek" togglegroup="togfiction"]Target Content[/expand]
[expand title="Battlestar Galactica" togglegroup="togfiction"]Target Content[/expand]
[expand title="Space Race" togglegroup="toghistory"]Target Content[/expand]
[expand title="Ansari X Prize" togglegroup="toghistory"]Target Content[/expand]
Star Wars
Target Content
Star Trek
Target Content
Battlestar Galactica
Target Content
Space Race
Target Content
Ansari X Prize
Target Content

Rel Highlander Grouping

Here is an example using the rel attribute with highlander grouping:

[expand title="Star Wars" rel="fiction-highlander" swaptitle="Not Star Trek"]Target Content[/expand]
[expand title="Star Trek" rel="fiction-highlander"]Target Content[/expand]
[expand title="Battlestar Galactica" rel="fiction-highlander"]Target Content[/expand]
[expand title="Space Race" rel="history-highlander"]Target Content[/expand]
[expand title="Ansari X Prize" rel="history-highlander"]Target Content[/expand]
Star Wars
Target Content
Star Trek
Target Content
Battlestar Galactica
Target Content
Space Race
Target Content
Ansari X Prize
Target Content

Highlander Grouping using Togglegroup Attribute

[expand title="Monkeys" togglegroup="animal-highlander"]Target Content[/expand]
[expand title="Donkeys" togglegroup="animal-highlander"]Target Content[/expand]
[expand title="Tigers" togglegroup="animal-highlander"]Target Content[/expand]
[expand title="Bears" togglegroup="animal-highlander"]Target Content[/expand]
[expand title="Porsche" togglegroup="car-highlander"]Target Content[/expand]
[expand title="Volvo" togglegroup="car-highlander"]Target Content[/expand]
[expand title="Mercedes" togglegroup="car-highlander"]Target Content[/expand]
Monkeys
Target Content
Donkeys
Target Content
Tigers
Target Content
Bears
Target Content
Porsche
Target Content
Volvo
Target Content
Mercedes
Target Content

Group Attribute

This is a test of the group attribute which is being considered to replace rel, will be used as an alias for now:

[expand title="Star Wars" group="gfic" swaptitle="Not Star Trek"]Target Content[/expand]
[expand title="Star Trek" group="gfic"]Target Content[/expand]
[expand title="Battlestar Galactica" group="gfic"]Target Content[/expand]
[expand title="Space Race" group="ghis"]Target Content[/expand]
[expand title="Ansari X Prize" group="ghis"]Target Content[/expand]
Star Wars
Target Content
Star Trek
Target Content
Battlestar Galactica
Target Content
Space Race
Target Content
Ansari X Prize
Target Content

Quick test to make to see if our ‘number’ issue has been fixed:

[expand title="123" rel="123"]this is a number group[/expand]
[expand title="456" rel="456"]this is also a number group[/expand]
123
this is a number group
456
this is also a number group

collapse-o-matic with inline link

This is an example of a collapse element with an inline link.

[expand title="this is a test with a <a href='https://plugins.twinpictures.de'>link</a>"]here is some hidden content[/expand]

the key is to use double quotes to wrap the title attribute and single quotes for the html inside the double quotes.

this is a test with a link
here is some hidden content

Collapse-O-Matic Numbers as ID Issue

This is a quick post to test the issue when using numbers as IDs as brought up in this thread:
https://wordpress.org/support/topic/multiple-titles-open-when-clicking-on-one/

To recreate this we will use two collapse elements with the ID’s of 1,2,3, 11, 12 and 13.

Trigger One
Content for ID one

Trigger Two
Content for ID two

Trigger Three
Content for ID three


Trigger Eleven
Content for ID eleven

Trigger Twelve
Content for ID twelve

Trigger Thirteen
Content for ID thirteen

The issue is the toggle selectors where using the following jQuery selector:

jQuery('[id^=target][id$='+id+']')

As of collapse-o-matic version 1.7.9 the selector is a more exact:

jQuery('#target-'+id)

Collapse-O-Matic Nested SwapTitles

[expand title="Fiction" rel="fiction" swaptitle="Is like non-non-fiction"]
[expandsub1 title="Star Wars" rel="submenu-highlander" swaptitle="Hyperspeed" expanded="true"]Target Content[/expandsub1]
[expandsub1 title="Star Trek" rel="submenu-highlander" swaptitle="Warpspeed"]Target Content[/expandsub1]
[/expand]

Fiction

Star Wars
Target Content

Star Trek
Target Content

Collapse-O-Matic Grey Bar Style

Here is an example of how to pimp the collapse-o-matic expand to use a grey bar style using CSS.
Be sure you are using the div ad your default tag in the plugin settings.

The CSS:

.greybar {
   border: 1px dotted #aaaaaa;
   padding: 7px;
   background-position: 98% center;
   background-color: #cccccc;
}

The Code:

[expand trigclass="arrowright greybar" title="Monkeys Are Fast"]...[/expand]

Monkeys Are Fast

To give the target content a border, use the targclass attribute:

The CSS:

.blueborder {
   border: 1px dotted blue;
   border-top: none;
   margin-left: 0;
  padding: 5px;
}

The Code:

[expand trigclass="arrowright greybar" targclass="blueborder" title="Monkeys Are Fast"]...[/expand]

Monkeys Are Fast
To add a graphic to the background, simply create a new class and add the appropriate css:

.de_flag {
    background-image: url(https://lipis.github.io/flag-icon-css/flags/4x3/de.svg);
    background-size: 64px 16px;
    background-repeat: no-repeat;
    background-position: -10px center;
    padding: 7px 7px 7px 42px;
}

then add the new class to the trigclass attribute:

[expand trigclass="arrowright greybar de_flag" title="Deutschland"]...[/expand]

Deutschland