Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-17 10:25:46

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Article date beside the title of each article when listed by category

How to get it?
I’ve tried with: Posted on: <txp:posted /> (in the following <if category>) without succeed in doing it:

<txp:if_section name=“abcdefg”>

<p><txp:recent_articles category=“houses” label=”<b>This are some kind of houses</b>” sort=“Posted desc” wraptag=p break=p limit=“10” /> – Posted on: <txp:posted /></p>

<p><txp:recent_articles category=“dogs” label=”<b>Thisare some kind of dogs</b>” sort=“Posted desc” wraptag=p break=p limit=“10” /> – Posted on: <txp:posted /></p>

</txp:if_section name=“abcdefg>

[…] etc.

The result has been a date appears only at the end of each category list, not beside each article listed, why?

Si I can see <txp:posted /> works only to show the date at the bottom of each article.

Last edited by Bongo-man (2009-08-17 10:43:41)

Offline

#2 2009-08-17 16:02:04

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Article date beside the title of each article when listed by category

<b>This are some kind of houses</b>
<txp:article_custom category="houses" sort="Posted desc" wraptag="p" break="br" limit="10">
     <txp:permlink><txp:title /></txp:permlink> - Posted on: <txp:posted />
</txp:article_custom>

BTW, if you use <p> tags around your code, and wraptag="p" and break="p", you’ll get something like this:

<p>Your label here
<p><p>article 1</p>
   <p>article 2</p>
   <p>etcetera</p>
</p>
</p>

…which isn’t valid html at all ;)

(Edit: fixed typo in title tag, thanks MattD!)

Last edited by els (2009-08-17 19:59:45)

Offline

#3 2009-08-17 17:26:38

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: Article date beside the title of each article when listed by category

Ok, but it does not work any way.
What is the solution for my question?

Offline

#4 2009-08-17 17:36:25

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Article date beside the title of each article when listed by category

<b>This are some kind of houses</b>
<txp:article_custom category="houses" sort="Posted desc" wraptag="p" break="br" limit="10">
     <txp:permlink><txp:title /></txp:permlink> - Posted on: <txp:posted />
</txp:article_custom>

Els code will give you the 10 most recent articles for that category. She had an extra space in the title tag that caused it not to work for me which I’ve fixed above.

Changed <txp:title / > to <txp:title />

You may need to modify the posted tag to get the format you want.

Last edited by MattD (2009-08-18 16:42:54)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#5 2009-08-17 18:00:54

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: Article date beside the title of each article when listed by category

Oook, I’m sorry I didn’t realize it.

..but all this is not what I need because it displays also di articles and I need only the titles (with their links) as shown by <txp:recent_articles> and beside them the date when the article was published.
Thanks

Last edited by Bongo-man (2009-08-17 18:44:55)

Offline

#6 2009-08-17 20:04:52

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Article date beside the title of each article when listed by category

MattD wrote:

He had an extra space in the title tag

Oops, sorry! Thanks Matt, I edited my post above. Oh, and er… she :)

Bongo-man wrote:

I need only the titles (with their links) as shown by <txp:recent_articles> and beside them the date when the article was published.

That’s what the tag does. If it seems to display something else for you, can you post a tag trace please?

Offline

#7 2009-08-18 15:48:16

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: Article date beside the title of each article when listed by category

I cannot because it displays my copyrighted contents.
What it appears on the screen is a sequence of articles and then (or perhaps before) a sequence of dates.
I need a sequence of links to the articles displayed in the form of categorized titles-links and next to them the date when each article was published. In a more simple way, I can say: I need to display a categorized index of articles with their respective publishing date.
thanks

Offline

#8 2009-08-18 16:54:36

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Article date beside the title of each article when listed by category

In hopes of clarifying when I tested the code Els provided (using a category from my site instead of houses) I get the following HTML

<b>This are some kind of houses</b>
<p>
     <a rel="bookmark" href="http://my-website.com/article/article31">Article 31</a> - Posted on: 41 days ago
<br />

     <a rel="bookmark" href="http://my-website.com/article/article30">Article 30</a> - Posted on: 55 days ago
<br />

     <a rel="bookmark" href="http://my-website.com/article/article29">Article 29</a> - Posted on: 57 days ago
<br />

     <a rel="bookmark" href="http://my-website.com/article/article28">Article 28</a> - Posted on: 300 days ago
<br />

     <a rel="bookmark" href="http://my-website.com/article/article27">Article 27</a> - Posted on: 335 days ago
</p>

which looks something like

(Sorry Els. I’ve corrected my above post.)

Last edited by MattD (2009-08-18 16:54:57)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#9 2009-08-18 17:32:35

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Article date beside the title of each article when listed by category

Bongo-man wrote:

I cannot because it displays my copyrighted contents.

A tag trace doesn’t display content, it displays tags. Did you read the instructions in the post I linked to? Put your site in debug mode, view the source, and scroll down until after the </html> tag. What you see there (in green) is the tag trace. It’s hard for us to find out what is wrong without it…

Offline

#10 2009-08-21 06:57:50

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: Article date beside the title of each article when listed by category

I don’t know why but in my code this expression make all the articles of tha category are displayed with below them their date as in your case.
Obviously I have in my code lot of similar expressions listed and I have changed (to try) only one of them.
So my problem is to have articles instead of titles listed, for the expression I have changed. I think this happen because ofthedifferent tag: <txp:article_custom> instead of <txp:recent_articles> .

Last edited by Bongo-man (2009-08-21 09:26:49)

Offline

#11 2009-08-21 07:54:16

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Article date beside the title of each article when listed by category

We really need a tag trace to tell what’s going on.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#12 2009-09-11 04:02:53

Bongo-man
Member
Registered: 2009-03-18
Posts: 243

Re: Article date beside the title of each article when listed by category

I thank you all (I checked this issue after some days…): the problem was in the repetition of the closing sign ‘/’ that I put, as follows, both at the end of the

‘<txp:article_custom category=“houses” sort=“Posted desc” wraptag=“p” break=“br” limit=“10” />’

and in the closing tag.

Then the expression: ‘<txp:permlink><txp:title /></txp:permlink> – Posted on: <txp:posted />’

didn’twork.
Now all works god.
Thanks
Bongo-man

‘</txp:article_custom>’

Offline

Board footer

Powered by FluxBB