Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-11-30 02:14:15
- snthr
- Member
- Registered: 2007-07-13
- Posts: 42
associating an external url with an article
i’m doing up a site at the moment where each article contains a chunk of text, an image, a list, and a link to a specific external url.
i’m associating the image with each article using <txp:article_image />; i was wondering if there is any way to associate a specific external url with each article, using much the same idea. i don’t think this functionality exists in the basic textpattern tags (though perhaps i’m missing something), but i was also hoping that there might be a plugin for this kind of thing.
thanks…
Offline
Re: associating an external url with an article
Hi snthr,
I think you are looking for <txp:custom_field />
.
Check this FAQ: How to use custom fields
Offline
#3 2007-12-01 01:49:48
- snthr
- Member
- Registered: 2007-07-13
- Posts: 42
Re: associating an external url with an article
that worked perfectly, thanks very much. :)
a related question: if i want to have a sidebar somewhere in the site with a list of all the urls given in the articles, what would be the ‘best practice’ way of setting it up? obviously i could type all the links out again into the body of another article and use that as the sidebar, but that seems like it’d be the worst way to do this. is there a way of getting these links that are now populating my custom fields to pop out in a nice neat list?
thanks…
Offline
Re: associating an external url with an article
is there a way of getting these links that are now populating my custom fields to pop out in a nice neat list?
With txp:article_custom it would easy.
<ul>
<txp:article_custom form="external-list" limit="20" />
</ul>
And in the article form called external-list:
<txp:if_custom_field name="external"><li><txp:posted />: <a rel="external" href="<txp:custom_field name="external" />"><txp:if_custom_field name="external" /></a></li></txp:if_custom_field>
Cheers!
Last edited by Gocom (2007-12-01 02:35:15)
Offline