Collapse-O-Matic Excerpt Shortcode Test

This is a standard collapse element with an plain text excerpt:
[expand title="trigger text" excerpt="excerpt text"]target content[/expand]

I am a little tea-pot
short and stout
Here is my handle, here is my spout.
p.s. the word little is wrapped in em tags:
I am a <em>little</em> tea-pot

Nesting Shortcodes In Shortcode Attributres

Now, what if we wanted to have the excerpt contain a shortcode…
well, no, The shortcode parser does not accept square brackets within attributes. But, what if we used placeholders?!


As of Collapse-O-Matic v1.6.3d placeholders have been added as a work-around that allows both HTML and shortcodes to be used within the title, swaptitle, startwrap, endwrap, excerpt and swapexcerpt attributes:
%(% = <
%)% = >
%{% = [
%}% = ]

So the simple syntax would look like this:
[expand title="trigger text" excerpt="%{%some_shortcode attribute='value'%}%"]target content[/expand]

Keep in mind that if double quotes are used to wrap the attribute, then single quotes must be used inside the nested shortcode’s attributes. Or, as the example below shows, single quotes used to wrap the attribute value, and double quotes inside the nested shortcode’s attributes.

So, a real world example would look like this:
[expand title='I am a little donkey' excerpt='%{%caption id="attachment_1493" align="alignnone" width="150"%}%<a href=""><img src="" alt="short and stout" width="150" height="150" class="size-thumbnail wp-image-1493" /></a> short and stout%{%/caption%}%']stuck in a manhole until someone pulled me out.[/expand]

I am a little donkey
short and stout
short and stout
stuck in a manhole until someone pulled me out.

HTML in Attributes

On some versions of WordPress the use of HTML in shortcode attributes is limited or not at all supported. In these cases you can use placeholders as a work-around, like so:

[expand title="Trigger Text %(%strong%)%Bold%(%/strong%)%"]Hidden Content[/expand]

Trigger Text Bold
Hidden Content

Yes it’s a bit messy but it does work. Let’s see if Collapse Commander can help clean up this clutter.

Collapse Commander

And finally here is a test using the Collapse Commander add-on plugin:
[expand cid="1537"/]

I’m a little donkey
short and stout
short and stout
Stuck in a manhole cover until someone pulled me out.

Oh, very cool! As an added bonus, there is no need to use placeholders. Collapse Commander accepts the full shortcodes in the excerpt fields, as shown in the following screenshot. Check it out:

No need for placeholders with Collapse Commander
No need for placeholders with Collapse Commander

Collapse-O-Matic Nested Spacing Issue

Solution 1: Remove all hard returns in source:

Observation and Interpretation

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec congue ornare lacus,

Focus On: Topics


Observation and Interpretation

Vestibulum ornare ante in nibh ullamcorper gravida. Aliquam rutrum arcu a metus pellentesque, auctor laoreet velit iaculis.


Cras sollicitudin pellentesque pellentesque. In hac habitasse platea dictumst. Mauris eu varius nisl.

Moravian Community Life

Women’s Roles

Material Culture

Purpose of Portraiture

The American Revolution: Boston

The American Revolution: Bethlehem, PA

The Artist: John Singleton Copley

The Artist: Johann Valentine Haidt

Discussion Questions

Primary Sources

Young Moravian Girl

  • Writings/ memoirs of 4 Moravian women
  • Extracts from Moravian diary confirming Haidt as teacher
  • Lafayette’s letter to his wife describing Bethlehem
  • Various Moravian portraits by Haidt and prints of Bethlehem

Mrs. George Watson

  • The death sermon of Mrs. Watson
  • Paul Revere’s print of the Bloody Massacre
  • John Singleton Copley’s letter about George Watson
  • George Watson’s resignation letter to Gen. Gage
  • Henry Pelham’s letter on Tea Party incident
  • Letter by Richard Clarke about tea shipment (Boston Tea Party)
  • Letter from Abigail Adams to Elizabeth Cranch about daughter of Mrs. George Watson
  • Various portraits of family members by Copley
  • Contemporary transcript of the Boston Massacre Trials