Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-21 18:05:58

kmamen
Member
Registered: 2008-05-28
Posts: 11

How do I create a table of contents?

How do you make a simple link from within an article’s text to go to
another article (on a new page) within Textpattern? What is the syntax you need to paste into
your article?
Ultimately I want a list of headings on one page that will direct the user to a series of articles on new pages.
Thank you in advance for any advice!

Offline

#2 2009-05-21 18:27:55

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: How do I create a table of contents?


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#3 2009-05-21 18:59:52

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: How do I create a table of contents?

Hey, nice plugin ;) However, I think kmamen is after something else. To link to an article by id, use the permlink tag. When you say “a series of articles”, how do you want to select them? By category, for example?


Code is topiary

Offline

#4 2009-05-21 19:20:19

kmamen
Member
Registered: 2008-05-28
Posts: 11

Re: How do I create a table of contents?

By series of articles, I mean a set of standalone articles that each have their own page. So, you would click on one of the tabs (sections) on the website and access the table of contents. Clicking on one of the titles would take you to a new page with the full article. The full article would not appear on the table of contents page. Would I create an article for the same section in order to get an ID number and then just hide it so it isn’t visible on the TOC page?
Using the permlink tag, what is the exact syntax? Would I put <txp:article=#>…contained statements…</txp:article=#> ..where # is the article ID?

Thank you very much!

Offline

#5 2009-05-21 19:33:11

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: How do I create a table of contents?

If I am understanding you correctly, this is a very common setup and can be automated so that you don’t have to enter individual tags to get the links. Indeed, this is the way Txp works out of the box. On a default installation, on the left there is a list of links showing

  • Home
  • About
  • Articles

Clicking “Articles” takes you to the front page for that section, where you see a list of linked article titles — all the articles in that section. (On a default installation there is only one article, so that’s all you see.) Clicking the link takes you to the full article. Is that what you’re after?


Code is topiary

Offline

#6 2009-05-21 19:44:40

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: How do I create a table of contents?

Sorry guys – I was in a rush when I posted and never really got past the thread title!

Last edited by keith (2009-05-21 19:45:03)


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#7 2009-05-21 20:05:16

kmamen
Member
Registered: 2008-05-28
Posts: 11

Re: How do I create a table of contents?

Yes, exactly.

Offline

#8 2009-05-22 02:14:54

kmamen
Member
Registered: 2008-05-28
Posts: 11

Re: How do I create a table of contents?

jsoo, so how might one set up the kind of scenario you laid out at 12:30?

Offline

#9 2009-05-22 03:01:47

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: How do I create a table of contents?

kmamen wrote:

jsoo, so how might one set up the kind of scenario you laid out at 12:30?

Better to refer to the post by number, or quote from it, because the time you referred to depends on your time zone.

I hadn’t answered your second-to-last post until now, taking “Yes, exactly” to mean you had the information you were after.

Again, starting from a default installation, this will happen automatically: as soon as you post a new article in section “Articles”, you will get the linked title to it on the Articles section front page (i.e., the page with a URL something like http://example.com/articles/ or http://example.com/?s=articles, depending on the permanent-link-mode preferences you have set), and you will see the full article on the Home page. Basic CMS behavior. You can rename the sections or make new ones in Presentation -> Sections. If you don’t want the full article to appear on the Home page (or if there are other formatting changes you want) you need to start tweaking article forms.

There is lots to discover: refer to TextBook frequently, ask questions here, experiment, take things one step at a time. When I started with Txp (my first CMS) my head felt like wood for about a week, and then things started to come together. Most people seem to pick it up a little quicker than I did ;)


Code is topiary

Offline

Board footer

Powered by FluxBB