Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-09-22 02:15:56
- scdoody
- Member
- Registered: 2006-10-18
- Posts: 129
Help with article links
I have a page where there is a list or articles – each item in the list has a title and excerpt text and then I want to have a link to another page I’ve created that will pull in the full text for that article.
If I am on the page with the article list – what link should I use on each item in the article list to take people to the article detail page for that specific article – how do I build that tag – it seems like it needs to have something like name-of-article-detail-page.php?id=number . . . how would I do that in Textpattern language??
Thanks
Offline
Re: Help with article links
are you publishing your articles right into the section/page where your article list is? or are they published to the section/page where you want the full article text?
if its the latter, you could simply use <txp:article_custom> since you’re showing the article list on a different page vs. the original page where you want the full article to show.
so on the page where your article list is being displayed:
<txp:article_custom section="section your articles are originally posted in" form="show title and excerpt blah blah">
where the contents of form “show title and excerpt blah blah” probably has something similar to:
<txp:permlink><txp:title /></txp:permlink>
<txp:excerpt />
Offline
Re: Help with article links
You need some conditionals wrapped around your article tags. See the Textbook reference for info.
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#4 2007-09-22 15:06:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Help with article links
scdoody wrote:
Here is what I think I need to do: build another page or form that is specifically for the Full Article. So what I need help with is how to do make the title link on the excerpt link to this new Full Article Detail page that I need to create?
You don’t need another page, just two forms, one for the excerpt list and one for the full article. It’s also not really necessary to use conditionals. Use this on your page:
<txp:article limit="123" form="full_article_form" listform="excerpt_form" />
‘excerpt_form’ can look something like this:
<txp:permlink><txp:title /></txp:permlink>
<txp:excerpt />
<p><txp:permlink>Read more...</txp:permlink></p>
‘full_article_form’ something like:
<h3><txp:title /></h3>
<txp:body />
Offline
Pages: 1