Quick Index

Add a table of contents quickly in Joomla!

  • Last updated: 25-Jan-2018
  • Version: 1.1.0
  • Type: System plugin

Do you like Quick Index?

Rate it!

Tutorial for Quick Index

There is a Free and a Pro version of Quick Index.
The parts in this tutorial that only concern the Pro version will be marked with: Pro only

Introduction

With Quick Index you can easily add an index (Table of Contents) to your content. The index will be generated based on the headings in your content.

Simply place {index} where you want the index to show.

You can see Quick Index in action on this page at the top, and on all other Videos, Tutorial and FAQs pages on this website.

How to use it (syntax)

It is very easy to create an index: Simply place {index} at the top of your content.

Quick Index will replace the {index} tag with an index block. This will contain links to the different headings in your content.

You will need to use the heading tags (<h1> to <h6>) in your content to tell Quick Index what the headings are.

Quick Index will only collect the headings found AFTER the {index} tag.

Note: Quick Index is most stable and reliable if you place the {index} tag on its own new paragraph line.

Extra parameters

Further on in this tutorial you will see you can control how what the index includes and how it looks.

There are a lot of options in the Quick Index system plugin settings in which you can set up the default behaviour.
But you can just about overrule every default setting via the {index} tag by adding extra parameters.

The syntax of these parameters looks like name="value", which you might recognise from how html works.

As soon as you add parameters, you will need to place the tab title in a parameter too, like:

{index ordered="false" max_depth="3"}

Ordered vs unordered

The index will be dispayed as an ordered list by default.

To override the default setting in the tag you can do:

{index ordered="false"}

This will result in something like:

If the default is set to unordered, and you want the index ordered, you can do:

{index ordered="true"}

And this will result in something like:

Ordered list style Pro only

In the Pro version of Quick Index you can set the list style ordered index lists should use. The default is normal numbering. But you can also choose any of these:

Choosing which headings to include in the index

By default Quick Index will create an index from all found headings under the {index} tag.

But you have multiple ways to tell Quick Index which headings to include and which it shouldn't.

Excluding specific headings

You can exclude specific headings from the index by simply giving it a noindex classname. For instance:

<h2 class="noindex">I don't want to index this heading!</h2>

In the system plugin settings you can set up extra classnames to ignore in the No Index Classnames option.

Definig the end of the content

Quick Index will include all headings under the {index} tag.
But you might want the index to only show the headings from the first section of your content.
Or you want to split the content up in blocks and have each block use its own index.

Quick Index will automatically mark the end of a section when it finds a new {index} tag.
You can also place a closing {/index} tag at the end of the section, when you do not want to start a new index.
The index will only include headings found between the opening {index} and the next {index} tag or closing {/index} tag.

 

This example will show 2 indexes, one for Fruit and one for Animals.

{index}

Fruit (H1)
Fruit is yummy.

Apples (H2)
Apples are round and delicious.

Bananas (H2)
Bananaaaaas !

{index}

Animals (H1)
Furry animals!

Cats (H2)
Aaah... a cat :)

Dogs (H2)
Sit!

{/index}

Minimum and Maximum depth Pro only

By default all <h1> to <h6> tags will be included.

If you only want the <h1>, <h2>, <h3> headings in the index, you override the maximum depth setting:

{index max="3"}

To only include the <h2> and <h3> headings, you override the minimum and maximum depth setting:

{index min="2" max="3"}

Automatically number headings Pro only

The Pro version of Quick Index has an option to automatically prepend the headings in the content with the numbers used in the index.

An example:

1. Fruit

Fruit is yummy.

1.1. Apples

Apples are round and delicious.

1.1. Bananas

Bananaaaaas !

2. Animals

Furry animals!

1.1. Cats

Aaah... a cat :)

1.1. Dogs

Sit!

Styling

As you can see, the index gets a grey block around it. This is because the div element around the index gets a default classname of well. You can change this (or add classnames) in the Quick Index system plugin settings.
The well class is styled by Bootstrap. So if you use a template using Bootstrap, you will also see this default styling.
But you are free to give this any classname you want.

Also many other elements in the index get classnames which you can configure in the settings.

Because of these classnames you have full freedom to style the index whatever whay you want via CSS.
I recommend you place your custom css styles in a custom stylesheet loaded by your template.

The container div also always gets a fixed classname of rl_quickindex. So you can use that to base your custom styling on too.

As you can see in the index blocks at the top of the Videos, Tutorial and FAQs pages, I have styled them to show a looking glass icon as background. Here is the css styling for that.
This does require your template to already load the IcoMoon font (available in Joomla core).

.rl_quickindex:before {
    font-family: IcoMoon;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    speak: none;

    content: "\53";
    font-weight: 400;
    font-size: 160px;
    line-height: 160px;

    width: 160px;
    height: 160px;

    display: block;
    position: absolute;
    top: 20px;
    right: 0;
    
    opacity: .05;
}

Settings

Quick Index is packed with options, giving you control over how it works and behaves. Here is the full list of the options you can find in the Quick Index system plugin settings:

Styling

Classname Set a classname to add to the div tag around the index list.
Classname List Set a classname to add to the index list tag.
Classname Headings Set an optional classname to add to the heading tags.
Classname Numbers Set a classname to add to the span around the numbers added to the headings.

Behaviour

Index Title Enter a title that will be placed at the top of the index list. This value will be handled as a Joomla language string.
Index Title Heading Select the heading tag to use for the index title.

Options: h1, h2, h3, h4, h5, h6
Minimum Level Set the minimum heading level to include in the index.

Options: h1, h2, h3, h4, h5, h6
Maximum Level Set the maximum heading level to include in the index.

Options: h1, h2, h3, h4, h5, h6
Ordered List Select whether to use ordered or unordered lists.

Options: No, Yes, Set individually Pro only
Ordered List Style Set the ordered list style.

Options:
1, 2, 3
A, B, C
a, b, c
I, II, III
i, ii, iii

Tag Syntax

Quick Index Tag The word to be used in the tags.

Note: If you change this, all existing tags will not work anymore.
Tag Characters The surrounding characters of the tag syntax.

Note: If you change this, all existing tags will not work anymore.

Options: {...}, [...], {{...}}, [[...]], [:...:], [%...%]

Other Settings

No Index Classnames A comma separated list of classnames. Headings with any of these classname will not be included in the index.
Index Title Classnames A comma separated list of classnames. Headings with any of these classname will be displayed as a heading inside the index list.
Index Title Offset Set an ofset to be used as heading tag inside the index.

For instance, if offset is set to 2 and a H1 heading has a title classname, it will appear as a H3 in the index.
Add Links Select whether to add anchor links to the items in the index list.
Add Links to Titles Select whether to add anchor links to the titles inside the the index list.
Add Number to Headings Select whether to add the generated number to the headings.

Options: No, Yes, Only when ordered
Number Separator Set the character to place after the number, before the heading text.
Add Number to IDs Select whether to add the generated number to the ids used for linking.
Disable on Components Select in which frontend components NOT to enable the use of this extension.
Remove in Disabled Components If selected, the plugin syntax will get removed from the component. If not, the original plugins syntax will remain in tact.
Place HTML comments By default HTML comments are placed around the output of this extension.

These comments can help you troubleshooting when you don't get the output you expect.

If you prefer to not have these comments in your HTML output, turn this option off.

Installation

You can either install Quick Index by using the core extension manager available in the Joomla! Administrator Control Panel, or by using the powerful Regular Labs Extension Manager.

Note: When updating Quick Index, you do not need to uninstall it first. The package will update all the files automatically.

Keep in mind that when you update to a major new version (or uninstall first), you might lose some configuration settings.

Regular Labs Extension Manager

It is very easy to install/update any Regular Labs Extension using the Regular Labs Extension Manager.

Please see the Tutorial for the Regular Labs Extension Manager for more detailed information...

Joomla! Extension Manager

To install via the Joomla! Extension Manager, just follow these steps:

  1. Log into your Joomla administrator;
  2. In the menu, choose: Extensions >> Extensions;
  3. Choose the tab: Install from Web (or enable it if you haven't done so yet);
  4. Select the search field and enter Quick Index and hit enter;
  5. Click on the Quick Index listing;
  6. Click on Install;
  7. Click on Install to confirm.
Joomla! Installer - Install from Web

Or if you need to install the Pro version or cannot install via the 'Install via Web' method for some reason:

  1. Download the extension install file (.zip);
  2. Log into your Joomla administrator;
  3. In the menu, choose: Extensions >> Extensions;
  4. Choose the tab: Upload Package File;
  5. Click on the Choose File button and select the extension zip;
  6. Click on Upload & Install.
Joomla! Installer - Upload Package File

If you have problems installing Quick Index, please try the manual installation process as described here: docs.joomla.org/Installing_an_extension