Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-07 10:19:24

Nichod
Member
Registered: 2005-06-06
Posts: 119

TXP: Related articles

Can the <code><txp:related_articles /></code> be linked into a form? It states column and page, but I’m not entirely sure what is meant by that.

What I’m attempting to do is in the article form have 2-3 of the most recent related articles linked to. So that when I post an article in “catergory b” 3 links will show below the article to related articles in catergory b that might interest the reader.

Offline

#2 2005-12-07 10:51:55

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

Re: TXP: Related articles

That just means that it is a tag that doesn’t have to be within the form for it to work; it can go in a form, but it can also go in a page. What you’re after is what the tag does, it just doesn’t really matter where you place it. :)

Edit: I should add that it will only work on an individual page though.

Last edited by Mary (2005-12-07 10:53:23)

Offline

#3 2005-12-07 16:17:30

Nichod
Member
Registered: 2005-06-06
Posts: 119

Re: TXP: Related articles

Ok. Am I wrong in thinking that the related_articles can be placed in the “single” form and it will then be displayed when a visitor clicks the title or a read more link?

I placed the following code in the single form:
<br />
<code>
<div class=“container”>
<div class=“wrap”>
<div class=“title”><txp:permlink><txp:title /></txp:permlink></div>
<div class=“subtitle”><txp:posted /><br />
<txp:if_comments>
<p><txp:comments_count/> Comments</p>
<txp:else />
nope
</txp:if_comments></div>
</div>
<div class=“article”>
<txp:body />
<p> <txp:comments_invite /> </p>
<p>You might also be interested in: <txp:related_articles limit=“2”/></p>
</div>
</div>
</code>

Offline

#4 2005-12-07 18:02:45

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

Re: TXP: Related articles

Yes, just what I said. You can put it anywhere, that’s what the tag does. Haven’t you tried it yet?

Offline

#5 2005-12-08 18:53:01

Nichod
Member
Registered: 2005-06-06
Posts: 119

Re: TXP: Related articles

I did try it. And for some reason its not working. Am I wrong in thinking that this will show up when the article permlink is clicked.

Last edited by Nichod (2005-12-08 18:53:20)

Offline

#6 2005-12-08 19:05:56

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

Re: TXP: Related articles

Nope, that is supposed to work. Can you please post the page and form you’re using?

Offline

#7 2005-12-08 19:07:20

Nichod
Member
Registered: 2005-06-06
Posts: 119

Re: TXP: Related articles

The page is as follows:

<code>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” lang=“en” xml:lang=“en”>
<head> <meta http-equiv=“content-type” content=“text/html; charset=utf-8” /> <link rel=“stylesheet” href=”<txp:css />” type=“text/css” media=“screen” />
<title></title>
</head>
<body>
<txp:password_protect login=“test” pass=“test” />
<div id=“header”>
hey look. its the header.
</div>

<div id=“nav”>

isn’t navigation grand!

<div class=“spacer”>

&nbsp;
</div>
</div>

<div id=“content”>
<txp:article limit=“5” />
<txp:if_individual_article>
<p>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next>
</p>
</txp:if_individual_article>
<txp:if_article_list>
<p>
<txp:older>Previous</txp:older>
<txp:newer>Next</txp:newer>
</p>
</txp:if_article_list>

<div class=“spacer”>
&nbsp;
</div>
</div>
<div id=“footer”>
FOOT!
</div>

</body>
</html>
</code>

Offline

#8 2005-12-08 19:10:07

Nichod
Member
Registered: 2005-06-06
Posts: 119

Re: TXP: Related articles

The single form is formated as follows:

<code>
<div class=“container”>
<div class=“wrap”>
<div class=“title”><txp:permlink><txp:title /></txp:permlink></div>
<div class=“subtitle”><txp:posted /><br />
<txp:if_comments>
<p><txp:comments_count/> Comments</p>
<txp:else />
nope
</txp:if_comments></div>
</div>
<div class=“article”>
<txp:body />
<p>You might also be interested in: <txp:related_articles limit=“2”/></p>
</div>
</div>
</code>

Thank you very much for all the help. Its much appreciated.

Last edited by Nichod (2005-12-08 19:11:33)

Offline

#9 2005-12-08 19:11:47

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

Re: TXP: Related articles

You need to tell the article tag which form to use. Right now it’s only using the form named “default”.

Offline

#10 2005-12-08 19:17:56

Nichod
Member
Registered: 2005-06-06
Posts: 119

Re: TXP: Related articles

Ok…maybe I’m not understanding things. The page I posted is the “default” page. The form is the single. I need a different page for the single? Is it the archive template this form is using? And if so can you explain what the page needs?

Offline

#11 2005-12-08 21:35:57

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: TXP: Related articles

The “article” tag that you have in your PAGE template automatically calls the default FORM template to format how your articles will look on-screen. If you want to use a different FORM you need to use an “attribute” in the article tag like so <code><txp:article limit=“5” form=“single” /></code>.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#12 2005-12-08 23:53:20

Nichod
Member
Registered: 2005-06-06
Posts: 119

Re: TXP: Related articles

hmm. I think we are getting confused. The default page calls up the default article form. Which is fine. And when I click the permlink for the article it then goes to?

Offline

Board footer

Powered by FluxBB