Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » a name=

#1 2006-01-16 19:21:43

minusf
Member
Registered: 2005-02-15
Posts: 104

a name=

how can i make table of contents, links to the same page?

you know,
<code><a name=“intro”><h1>introduction</h1></a></code>


we is experts™

Offline

#2 2006-01-17 02:01:29

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: a name=

Does this have anything to do with Textile? Your question isn’t clear at all.


Alex

Offline

#3 2006-01-17 09:45:34

minusf
Member
Registered: 2005-02-15
Posts: 104

Re: a name=

Does this have anything to do with Textile? Your question isn’t clear at all.

i have a long long document.
i want a table of contents at the top, with links to all
the h1’s which the document contains

i think this is quiote straightforward and far from advanced…

does textile support <code><a name=“name”></code> type anchors?


we is experts™

Offline

#4 2006-01-17 10:13:35

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: a name=

name is mostly deprecated iirc, id should be used.

So you should be able to do things like :

<code>h2(#toc123). A header</code>

And target them with your table of content. But this toc has to be made by hand, unfortunately.

Offline

#5 2006-01-17 10:23:55

minusf
Member
Registered: 2005-02-15
Posts: 104

Re: a name=

thanks Jeremie, it looks now a bit better.

it’s a shame that textile can’t do this.
seems like basic functionality to me..

something like:

<pre><code>h1. toc header
h1. toc header
h1. toc header

toc header
h1(#toc2). toc header
h1(#toc3). toc header</code></pre>


we is experts™

Offline

#6 2006-01-17 11:27:58

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: a name=

Well, Textile can do what you just describe. By hand.

What Textile/Textpattern can’t do, is <txp:toc /> and all is done automatically (as MediaWiki does, for example).

Offline

#7 2006-01-17 11:35:34

minusf
Member
Registered: 2005-02-15
Posts: 104

Re: a name=

you are right, it works ;-)
thanks.


we is experts™

Offline

#8 2006-01-17 21:13:39

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: a name=

This works as expected:

"toc 1":#toc1
"toc 2":#toc2
"toc 3":#toc3
h1(#toc1). toc 1
h1(#toc2). toc 2
h1(#toc3). toc 3

Alex

Offline

#9 2006-01-17 21:45:25

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: a name=

Yes it does. I should have said “are able” and not “should be able”. I use this for some time now, on one article, or on one half-static section composed by several things (html within section’s page, static persistant articles, article_custom output of an article list, etc.).

The automated toc would be quite useful though. But that’s a different topic for a different forum :)

Offline

#10 2006-01-17 22:51:49

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: a name=

probably not appropriate for this use case, but if you have a series of articles (e.g. questions in a faq) you can insert the article ID into a name or id and automatically create a TOC at the top linking down the page

Offline

  1. Index
  2. » Archives
  3. » a name=

Board footer

Powered by FluxBB