Title: A shortcode within a shortcodes
Last modified: August 21, 2016

---

# A shortcode within a shortcodes

 *  Resolved [coreevoyage](https://wordpress.org/support/users/coreevoyage/)
 * (@coreevoyage)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/)
 * Hello,
 * I was wondering if it was possible to use other shortcodes within one of your
   shortcodes:
 * [expand title=”First title”][expand title=”Second title”]Content[/expand][/expand].
 * Thanks in advance.
 * [http://wordpress.org/plugins/jquery-collapse-o-matic/](http://wordpress.org/plugins/jquery-collapse-o-matic/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418187)
 * Yes.
    [http://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/#nested](http://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/#nested)
 *  Thread Starter [coreevoyage](https://wordpress.org/support/users/coreevoyage/)
 * (@coreevoyage)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418380)
 * Thanks a lot for your answer! It works perfectly!
    I have another question though.
   I’m using some columns shortcode. Would it be possible to override the columns
   width to allow the collapsed text to show in a wider block rather than in the
   predefined column width (for example 400px instead of 150px in the case of a 
   5 columns grid). Thanks again.
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418382)
 * That depends. Do you have a link you care to share?
 *  Thread Starter [coreevoyage](https://wordpress.org/support/users/coreevoyage/)
 * (@coreevoyage)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418383)
 * [http://www.coreevoyage.com/test-page-circuit/](http://www.coreevoyage.com/test-page-circuit/)
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418386)
 * Ok, so you have collapse elements in columns. The columns have fixed sizes. So
   all content inside these divs will force-fit to the column width.
 * What you could do is use the [roll-your-own method ](http://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/#roll-your-own)
   and place the target content someplace outside of the column.
 * For example:
    **Trigger**
 *     ```
       <div class="collapseomatic" id="item1" rel="items-highlander" title="Item One"><img src="http://www.coreevoyage.com/wp-content/uploads/2013/11/gastronomie-273x182-1.jpg"></div>
       ```
   
 * **Target**
 *     ```
       <div id="target-item1" class="collapseomatic_content">25. Des abris anti-aériens&nbsp;aux marchés financiers...</div>
       ```
   
 *  Thread Starter [coreevoyage](https://wordpress.org/support/users/coreevoyage/)
 * (@coreevoyage)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418387)
 * Here is the code I integrated. Unfortunately, the content gets displayed on the
   right side of the picture, which makes the other picture move below. The ideal
   would be to have the content displayed below the picture.
 * `[gn_column size="1/3"]<div class="collapseomatic" id="item1" rel="items-highlander"
   title="Item One"><img src="http://www.coreevoyage.com/wp-content/uploads/2013/
   11/gastronomie-273x182-1.jpg"></div>[/gn_column]`
 * `<div id="target-item1" class="collapseomatic_content">25. Des abris anti-aériens
   aux marchés financiers. Se relevant d'une guerre terrible qui tua près d'un million
   de personnes, Séoul a simplement explosé en moins de 50 ans pour devenir l'une
   des 10 premières villes les plus puissantes économiquement à travers le Monde,
   et la deuxième plus grande zone métropolitaine. Peu importe, petit ou grand, 
   il n'est pas de tâche que les Séoulites n'aient pu finir à temps (ou en avance)
   </div>`
    `
 *  Thread Starter [coreevoyage](https://wordpress.org/support/users/coreevoyage/)
 * (@coreevoyage)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418388)
 * Well, you wrote that “The columns have fixed sizes. So all content inside these
   divs will force-fit to the column width.”. So I guess there isn’t any solution
   to have the content’s width override the column’s width, right?
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418393)
 * No if the columns have a fixed with (and they do).
    What you would need to do
   is place the target div someplace outside of a column. You might also want to
   give the target div a special class and define the width of that class. Something
   like:
 * **Target**
 *     ```
       <div id="target-item1" class="collapseomatic_content my_class">25. Des abris anti-aériens aux marchés financiers....</div>
       ```
   
 * **CSS**
 *     ```
       .my_class {
       width: 300px;
       }
       ```
   
 *  Thread Starter [coreevoyage](https://wordpress.org/support/users/coreevoyage/)
 * (@coreevoyage)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418394)
 * Ok, thanks a lot.
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418425)
 * You are quite welcome. Good luck and don’t forget to [vote for Pedro](http://wordpress.org/support/view/plugin-reviews/jquery-collapse-o-matic)!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘A shortcode within a shortcodes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jquery-collapse-o-matic_fffeff.svg)
 * [Collapse-O-Matic](https://wordpress.org/plugins/jquery-collapse-o-matic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jquery-collapse-o-matic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jquery-collapse-o-matic/)
 * [Active Topics](https://wordpress.org/support/plugin/jquery-collapse-o-matic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jquery-collapse-o-matic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jquery-collapse-o-matic/reviews/)

## Tags

 * [RTFD](https://wordpress.org/support/topic-tag/rtfd/)

 * 10 replies
 * 2 participants
 * Last reply from: [Baden](https://wordpress.org/support/users/baden03/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/a-shortcode-within-a-shortcodes/#post-4418425)
 * Status: resolved