Quick Index

Index in Modal Window

11 months 2 days ago #80629

Daniel Michaels's Avatar Daniel Michaels

I tried creating an index in a modal window. It almost worked.
It shows the TOC, but when you click on an item the model window does not close.

{modal html="{index}"}Table of Contents{/modal}

In an ideal world I'd love the Bootstrap plugin that inserts a dynamic TOC embedded in the "sidebar" (or at least in a div). afeld.github.io/bootstrap-toc/
Even so, this plugin is a great start. Great work!

11 months 1 day ago #80637

Peter van Westen's Avatar Peter van Westen Admin

That won't work.
You would need to add an onclick="jQuery.colorbox.close();" to every link in that TOC index.

Quick Index cannot do that automatically.
You could use ReReplacer PRO to do that for you.

<a href="#
<a onclick="jQuery.colorbox.close();" href="#
And make it only search between (options under the Search Area tab):
<!-- START: Quick Index -->
<!-- END: Quick Index -->

Also, {index} will generate a lot of html. So it is more stable to use this syntax for the {modal} tag:
{modal content="my-index"}Table of Contents{/modal}
{modalcontent my-index}

11 months 1 day ago #80642

Daniel Michaels's Avatar Daniel Michaels

Awesome! Thank you. I'll give that a try.