Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Convert
Wordpress to Elxis
with
Elxis importer
!
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
General
(Moderators:
Ivan Trebješanin
,
Farhad Sakhaei
) »
Table of Contents in an article
« previous
next »
Print
Pages: [
1
]
Author
Topic: Table of Contents in an article (Read 3364 times)
armpouniotis
Sr. Member
Posts: 377
Table of Contents in an article
«
on:
March 02, 2020, 14:13:45 »
Hi there !
is there any plugin or module that I can use, in order to make table of contents in an article ?
I want something similar to wikipedia pages, which have table of contents at the top of page !
Thank you in advance !
Christos
Logged
Christos Armpouniotis
nikos
Elxis Community
Hero Member
Posts: 1094
Re: Table of Contents in an article
«
Reply #1 on:
March 02, 2020, 14:41:13 »
Try the
Category map
module, which may can cover your needs. If you want to show more columns, in order the final result to look as table, then you can use copies of the module, displaying them one beside to the other. And in order to show the modules inside articles you can use the
Include module plugin
.
«
Last Edit: March 02, 2020, 14:51:40 by nikos
»
Logged
Elxis Community |
Open Source Web Lab
armpouniotis
Sr. Member
Posts: 377
Re: Table of Contents in an article
«
Reply #2 on:
March 02, 2020, 15:08:11 »
Category map doesn't do what I really want. It is not even close to wikipedia style.
Christos
Logged
Christos Armpouniotis
nikos
Elxis Community
Hero Member
Posts: 1094
Re: Table of Contents in an article
«
Reply #3 on:
March 02, 2020, 15:38:12 »
Your request was not so clear to me, so I supposed that you need something like category map.
Logged
Elxis Community |
Open Source Web Lab
michalis1984
Sr. Member
Posts: 334
Re: Table of Contents in an article
«
Reply #4 on:
March 02, 2020, 16:54:03 »
There is nothing ready for this. You can do it manually on each article (not very useful) or use a js library to create TOC automatically based on your content classes:
Like this:
https://advanced-js.github.io/syllabus/
or this:
https://tscanlin.github.io/tocbot/
or this:
https://www.jqueryscript.net/demo/jQuery-Plugin-For-Simple-Table-of-Contents-toc/
For your ease, you can create a simple content plugin to include and initialise the library in the desired articles.
«
Last Edit: March 02, 2020, 17:39:38 by michalis1984
»
Logged
armpouniotis
Sr. Member
Posts: 377
Re: Table of Contents in an article
«
Reply #5 on:
March 03, 2020, 11:53:17 »
Thank you for your solution, but
sorry but I can't do this in 100 pages !
Thank you anyway !
Christos
Logged
Christos Armpouniotis
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Table of Contents in an article
«
Reply #6 on:
March 03, 2020, 19:44:59 »
A table of contents needs nothing more than simple html with internal links.
Example:
<a href="#chapter1">Chapter 1</a><br />
<a href="#chapter2">Chapter 2</a><br />
<a href="#chapter3">Chapter 3</a><br />
<h3 id="chapter1">Chapter 1</h3>
<p>blah blah blah</p>
<h3 id="chapter2">Chapter 2</h3>
<p>blah blah blah</p>
<h3 id="chapter3">Chapter 3</h3>
<p>blah blah blah</p>
That's all!
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
armpouniotis
Sr. Member
Posts: 377
Re: Table of Contents in an article
«
Reply #7 on:
March 03, 2020, 19:50:24 »
Yes, I am aware of this coding very well, but I was just wondering if there is any other automatic way using any of the available modules, since I am about to have table of contents in many many articles !
Thank you anyways !
Christos
Logged
Christos Armpouniotis
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Table of Contents in an article
«
Reply #8 on:
March 03, 2020, 20:07:20 »
Hmmm.... (thinking...)
I can do something for you. I can create a plugin that will generate automatically a TOC on all of your articles but in order to work
each article has to contain h2 or h3 or similar tags
. The plugin will treat these headers as entries for the TOC. If there are no such headers in your articles such a plugin cannot work.
Example:
<h2>Section A</h2>
<h3>Section A1</h3>
<p>blah blah</p>
<h3>Section A2</h3>
<p>blah blah</p>
<h2>Section B</h2>
...
If your articles are formatted like that, or with just h3 tags, or with h2, or with h4, a special plugin could do your job. In order not to integrate the plugin on every page the plugin could work without integration into the editor by activating an option in its parameter. So you wont even have to edit your articles... I am also thinking of deactivating automatically the TOC in case only 1 H tag is found. Or even specific the categories you want the plugin to generate TOCs.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
armpouniotis
Sr. Member
Posts: 377
Re: Table of Contents in an article
«
Reply #9 on:
March 03, 2020, 20:17:43 »
Well, that looks a great idea of yours ! I think it is going to be useful in future tasks ! I what you have described so far about the plugin looks easy to use !
I am waiting for the final result !
Thank you in advance
Christos
Logged
Christos Armpouniotis
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
General
(Moderators:
Ivan Trebješanin
,
Farhad Sakhaei
) »
Table of Contents in an article