Twitter Bootstrap Collapse aka Accordian Shortcode

This plugin provides following shortcodes.

You must be using Twitter Bootstrap Framework for the accordian to work.

[collapse_group]


id:
(string) (optional) Specifid ID of the root element
Default: None

class:
(string) (optional) Add additional class to the root element. Note: it is added after the “accordian” class.
Default: None

[collapse]


id:
(string) (optional) Specifid ID of the root element
Default: None

class:
(string) (optional) Add additional class to the root element. Note: it is added after the “accordian” class.
Default: None

open:
(string) (optional) Whether the collapse should be opened by default.
Possible values: ‘y’ or ‘n’ Default: n

Example


        
[collapse_group id="optional_group_1"]
  [collapse title="my heading1" id="opt_id" open="y/n"]
    some text
  [/collapse]
  [collapse title="my heading2" id="opt_id" open="y/n"]
    some text
  [/collapse]
[/collapse_group]

HTML Output


	    
<div id="optional_group_1">
  <div>
    <div>
      <a data-toggle="collapse" data-parent="#accordion2" href="#opt_id">
        my heading1
      </a>
    </div>
    <div id="opt_id">
      <div>some text</div>
    </div>
  </div>
  <div>
    <div>
      <a data-toggle="collapse" data-parent="#accordion2" href="#opt_id">
        my heading2
      </a>
    </div>
    <div id="opt_id">
      <div>some text</div>
    </div>
  </div>
</div>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s