Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-15 18:41:33

blueprint
Member
From: Netherlands
Registered: 2006-03-05
Posts: 43
Website

How to get linked article list and complete articles on same page

What I want for a certain page is alle of the following on one page:
  • a list with article titles
  • a list with the same articles including the content of the article
  • an article title in the first list is hyperlinked to the content of that article on the same page.

Essentially the list with article titles is a ‘table of content’ for the whole page, so that visitors don’t have to scroll the whole page to find a certain article.

It is easy to create a list with hyperlinked articles in TXP, and it is also easy to create a list with articles including the content. And also no problem to create two seperate lists that are not connected.

But how to create two lists that are connected?? Help is very much appreciated.

Offline

#2 2006-08-15 23:32:00

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: How to get linked article list and complete articles on same page

You could use the article_id for your link and anchor. Something like this…

List in article form showing article titles…

<code>
<a href=”#article<txp:article_id />”><txp:title /></a>
</code>

&nbsp;

List in article form with article titles and content….

<code>
<h3 id=“article<txp:article_id />”><txp:title /></h3>
<txp:body />
</code>

&nbsp;

You can use the above to create a FAQ-like page, and even add permalinks to the individual articles created by this process, as that can help with search engine returns, as well as “on site” searches.

And I added the word “article” ahead of txp:article_id, as I believe id’s can’t start with a number in XHTML.

Last edited by reid (2006-08-15 23:37:41)


TextPattern user since 04/04/04

Offline

#3 2006-08-16 18:54:10

blueprint
Member
From: Netherlands
Registered: 2006-03-05
Posts: 43
Website

Re: How to get linked article list and complete articles on same page

This did the trick!!! Thank you for posting this solution

Offline

#4 2006-08-16 19:51:34

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: How to get linked article list and complete articles on same page

Great! This is exactly what I wanted to know in my parallel thread a few hours ago!

For a newbie like me there’s just one detail open: how do I build a linklist from <code><a href=”#article<txp:article_id />”><txp:title /></a></code>, now that txp:linklist doesn’t work any more?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2006-08-17 00:13:12

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to get linked article list and complete articles on same page

…how do I build a linklist… now that txp:linklist doesn’t work any more?

Er, what do you mean?

Offline

#6 2006-08-17 00:37:50

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: How to get linked article list and complete articles on same page

Yep, really confusing.
What I was trying to say is how do I build a list of links now that txp:linklist doesn’t work with Reid’s code.
[I tried Alexandra’s solution before that I found somewhere on her german site, where she explains how to build a linklist by putting txp:link in a link form and linklist in the page’s template. So linklist is a leftover of this try.]

But how can I let Reid’s solution build this list of links? As I understand it it does the one job I desired, it creates a relation between the anchor and the article. But how is the list generated? I can of course put all the links in one sticky article on top of the page. But for my client there must be a foolproof way to get the list of links built automatically. Is there a way to handle this?

Perhaps describing the page would help a bit: I’m using txp in a frameset only for the news page. There is no other page content than the list of links on top and the articles below. i.e. txp has to handle only a bunch of maybe 10 articles and 10 links, nothing else, there are no other sections to keep in mind.
So if there is a way of telling txp “take all the links there are in the database and put them on top of the page” it’d make me so glad!

Last edited by uli (2006-08-17 13:48:51)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2006-08-17 13:51:35

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: How to get linked article list and complete articles on same page

I’m sorry, I assumed you wanted to make a list of articles related to another list of articles using the txp:article tag.

However, txp:linklist is much more limiting in the options for formatting the list output. You’re right, the code I offered will not create a link list using txp:linklist … but it should not have broken the normal functionality of txp:linklist.

On my site, because of the limits of txp:linklist and other issues to do with my site, I made an entirely new section named links, which allows me more control over how each article is rendered (including mixing them with a section of quotes into a column on my home page )

Last edited by reid (2006-08-17 13:55:42)


TextPattern user since 04/04/04

Offline

#8 2006-08-17 14:34:13

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: How to get linked article list and complete articles on same page

reid, thank you for your response. i took a glance at your site, but it differs from what i want.
i saw the kind of links list i wish on other txp generated sites (alexandra’s german site for instance, and maybe even in textbook), but i fear they were hand-coded. or does anyone know a way of letting txp do the job automatically?

btw, what is the english term for such a link that only scrolls the page?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#9 2006-08-17 14:52:20

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: How to get linked article list and complete articles on same page

reid wrote:

You’re right, the code I offered will not create a link list using txp:linklist … but it should not have broken the normal functionality of txp:linklist.

but it neither can’t be used in conjunction with txp:linklist, or can it? misunderstood

Last edited by uli (2006-08-17 16:18:26)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB