Re: Accordion glyphs

Apr 8, 2014 at 2:54 PM
Does this (or any) version of bootstrap come with provision for putting little glyphs on the handle bar of an accordion (i.e. side arrow when it's closed, down arrow when it's opened)?

TIA
Josh
Coordinator
Apr 9, 2014 at 9:03 PM
Josh,

I am pretty sure that B2 had an accordion component but B3 does not. There are some glyph icons though build into B3 in case you are looking for icons to help. http://getbootstrap.com/components/#glyphicons-how-to-use.

How are you planning to create the accordion list? Content search WP, content Query WP? LIst view with js link? My general suggestion would be to use one of the many jquery libraries for this, or build your own custom library as accordions are very simple.

Eric
Apr 9, 2014 at 11:24 PM
Edited Apr 10, 2014 at 1:03 AM
Eric:

The most appropriate situation is a custom action in the Embed Group of the Insert tab, with a js link. It's intended to work (so far) only on HTML fields in Publishing pages
Apr 15, 2014 at 2:17 AM
The magic js snippet turns out to be:
var range = RTE.Cursor.get_range();
var mystuff = build_a_div_with_my_markup_in_it();
range.insertBefore(mystuff);
RTE.Cursor.update();
Coordinator
Apr 15, 2014 at 7:17 PM
Hi Josh,

I am confused how the JS you provided helped with adding the glyphs. It looks to me as though you are adding so content right before where the cursor is in a rich text editor, or before the highlighted content? Could you provide any more insight as to what you were attempting to do and how this code helped? That may help others come up with other useful solutions for their own projects based on your code.

Thanks.

Eric
Apr 15, 2014 at 7:37 PM
Eric:

Sorry, you're right. I haven't addressed the glyph parts yet.
But once I do, I'll make the entire thing public somewhere (suggestions welcome)

The RTE seemed to be very sparsely documented - the best docs turned out to be the Sharepoint scripts in _layouts

Regards
Josh