Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-01-09 22:20:40
- tc03
- Member
- Registered: 2007-11-06
- Posts: 92
recent article list problem
I am trying to output a list of recent articles, but am having the following problem…
I use this txp tag in my page:
<div id=“content”>
<txp:article form=“article” limit=“6” listform=“list” />
</div>
to call the following form:
<txp:recent_articles break=“br” label=“CURRENT ISSUE:” limit=“7” section=“articles” sort=“Title asc” break=“br”/>
but get the following html (the list is repeated instead of ending – title and all)
<div id=“content”>
CURRENT ISSUE:<br /><a href=“http://localhost/example.dev/articles/3/death-of-the-i-double-suicide-in-the-tell-tale-heart”>DEATH OF THE 'I': DOUBLE-SUICIDE IN 'THE TELL-TALE HEART'</a><br />
<a href=“http://localhost/example.dev/articles/4/eloisa-and-the-scene-of-writing-in-popes-eloisa-to-abelard”>Eloisa and the Scene of Writing in Pope’s “Eloisa to Abelard” by Albert Rolls</a>CURRENT ISSUE:<br /><a href=“http://localhost/example.dev/articles/3/death-of-the-i-double-suicide-in-the-tell-tale-heart”>DEATH OF THE 'I': DOUBLE-SUICIDE IN 'THE TELL-TALE HEART'</a><br />
<a href=“http://localhost/example.dev/articles/4/eloisa-and-the-scene-of-writing-in-popes-eloisa-to-abelard”>Eloisa and the Scene of Writing in Pope’s “Eloisa to Abelard” by Albert Rolls</a>
</div>
why is this happening?
also, if anybody could tell me how to put the articles in my own psecific order in the list i would appreciate it – that is, arrange them myself, rather than by date/title asc. desc. etc.
thanks.
Offline
Re: recent article list problem
so wait..you’re using the article tag to call a form populated with the recent articles tag??
Offline
Re: recent article list problem
Just in case that confused you tco3 the <txp:recent_articles />
tag can stand by itself and shouldn’t be called using a <txp:article />
tag. Just place the code you currently have in your form into your page instead, replacing that article tag or if you prefer, call the form using <txp:output_form form="list" />
though that is a bit of a waste of code.
Last edited by thebombsite (2008-01-10 00:15:17)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#4 2008-01-10 06:37:01
- tc03
- Member
- Registered: 2007-11-06
- Posts: 92
Re: recent article list problem
ok that takes care of one thing – thanks thebombsite (iblastoff, not so helpful) – any suggestions on how to customise the recent articles like i described (basically i want total control of the order they appear in).
cheers.
Offline
Re: recent article list problem
well i didn’t purposely NOT be helpful, i just wasn’t sure exactly what you were doing. i could have just linked you to the textbook entry for <txp:recent_articles /> and made you figure it out yourself that you aren’t supposed to put it in an article form. but i wasn’t sure thats what you were actually doing. hence the clarifying.
Available values for the sort attribute: ID (article id#), AuthorID (author), LastMod (date last modified), LastModID (author of last modification), Posted (date posted), Title, Category1, Category2, comments_count, Status, Section, Keywords, Image (article image id#), url_title, custom_1 through custom_10, rand() (random). Default is Posted desc.
you could utilize any of those to sort them exactly the way you want. ie. create a custom field ‘sort’ and give each the numerical order/preference of how you want them to show up. tons of options you can choose from.
Last edited by iblastoff (2008-01-10 06:48:21)
Offline
Re: recent article list problem
If you want to show the recent articles and not the order by title, as your label states “Current Issue” (btw. long-uppercase should be done with CSS).
<txp:recent_articles break="br" label="CURRENT ISSUE:" limit="7" section="articles" break="br" />
And voila, the are arranged by the posting date. If you want more clamorous output, like dates, images, extra xhtml elements, then you should look into article_custom – as the recent_articles is just a plain easy version for it.
And then we get:
<h3>Current Issue:</h3>
<ul>
<txp:article_custom limit="7" section="articles" form="issue-form" />
</ul>
And in article form named issue-form:
<li><txp:permlink><txp:title /> on <txp:posted /> by <txp:author /></txp:permlink></li>
As on example purpose only.
Cheers!
Offline
#7 2008-01-10 07:54:02
- tc03
- Member
- Registered: 2007-11-06
- Posts: 92
Re: recent article list problem
so that makes sense – one more thing – I have asked before, but i want to have the articles show without the author listed at the bottom (as the articles are written by others, but all posted by me, I don’t want my name at the bottom of others’ work, obviously), but can’t seem to find out why it is there…there are no author-related tags anywhere in my site…is it there by default? Can i remove it through preferences or something? (and, iblastoff, not trying to upset anybody .ty)
Offline
#8 2008-01-10 08:04:39
- tc03
- Member
- Registered: 2007-11-06
- Posts: 92
Re: recent article list problem
Also, I have this down the very bottom of the page when I view the source code
<!— Runtime: 0.1026 —>
<!— Query time: 0.083987 —>
<!— Queries: 14 —>
<!— Memory: 1993Kb, end of textpattern() —>
any way to get rid of it?
Offline
#9 2008-01-10 09:38:51
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: recent article list problem
…there are no author-related tags anywhere in my site…
There must be. Textpattern only outputs what you tell it to.
Also, I have this down the very bottom of the page when I view the source code…
Once you change your production mode to “Live” that goes away.
Last edited by Mary (2008-01-11 01:23:07)
Offline
Re: recent article list problem
Check which form your article tag is calling for and there should be a <txp:author />
in there somewhere. As Mary says TXP can’t output information unless it is asked to.
Also you might want to bookmark TextBook and scroll down until you see a link to “Tags”. This will give you all the information you need about tags, what they do and which attributes are available for them.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#11 2008-01-11 22:29:22
- tc03
- Member
- Registered: 2007-11-06
- Posts: 92
Re: recent article list problem
I am using the following for the article, not calling a form, but using this directly on the page:
<txp:article><h3><txp:title /></h3>
<br />
<br />
<txp:body />
<txp:link_to_prev>Previous Article</txp:link_to_prev>
<txp:link_to_next>Next Article</txp:link_to_next>
</txp:article>
Is the author included by default in the <txp:body> tag?
Offline
Re: recent article list problem
<txp:article />
is not a container tag. Documentation. You’re getting the author info from the default form.
Last edited by jm (2008-01-11 22:33:37)
Offline