Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-29 02:17:52

MattH
Member
From: Ann Arbor, MI
Registered: 2004-10-17
Posts: 30

Mix links and posts?

I’d like to mix short links in with my posts in chronological order on the homepage. Is this possible with the links content type? Intuition tells me no, but I’m hopeful, since there are a number of workarounds necessary to make the article entry form fill both duties.

Offline

#2 2009-08-29 14:20:46

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: Mix links and posts?

This should be possible, you just need some way to hook your posts and the links together. How are the links you want to display connected to the posts? By category? Date? Some keyword?

Offline

#3 2009-08-29 14:43:00

MattH
Member
From: Ann Arbor, MI
Registered: 2004-10-17
Posts: 30

Re: Mix links and posts?

Articles can be in any of a number of categories to display on the homepage. I’m just looking to display the links as if they were posts without comments, interspersed in the flow of the homepage — not necessarily associated with any article.

I’m looking to do this because I only write a longer post every couple days or so, but there are a number of links I’d like to mention in the meantime.

  • article
  • link
  • link
  • article

Offline

#4 2009-08-29 15:03:40

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: Mix links and posts?

Ah I see…well that is tricky. I’m not sure how you would get the links into the normal stream of articles, except to actually post them as articles.

The other possibility is a plugin called asv_tumblelog I’ve never used it, but what you want to do seems like it could be accomplished with it, plus much more.

Offline

#5 2009-08-29 15:18:43

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Mix links and posts?

The easier way is to associate a link with an article using a custom field.
This can be accomplished in a moltitude of ways.
I usually choose not to use the “links” tab at all. Just name a custom field as “link” and insert here the link.
Then in your page template something like this (of course adapted for you particular needs):

<txp:article_custom section="" wraptag="ul" break="li">
	<h3>
	<txp:if_custom_field name="link">
		<a href="<txp:custom_field name="link" />">
		<txp:title />
		</a>
	<txp:else />
		<txp:permlink><txp:title /></txp:permlink>
	</txp:if_custom_field>
	</h3>
	<txp:excerpt />
</txp:article_custom>

Last edited by redbot (2009-08-29 16:54:28)

Offline

Board footer

Powered by FluxBB