Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-01-31 06:28:30
- verum
- Member
- Registered: 2007-01-28
- Posts: 21
Recent Posts - Special Formatting?
Hey everyone… my first post here went unanswered, but I am undeterred. I also understand sometimes they fall through the cracks. I have a different question now though, so here I am.
So I’m building a bloggish site with TxP. I want to include a rating rumber (represented with an image) with each entry. I want to use this value to display an associated image elsewhere within the site. How do I assign this variable to every article so that when I write a new one I can enter the rating, and how do I call this value so that I can display it’s associated image elsewhere on the site (i.e. in a list of recent posts)?
Last edited by verum (2007-01-31 06:34:51)
Offline
#2 2007-01-31 15:10:49
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Recent Posts - Special Formatting?
Use a custom field. Name it ‘rate’ (for example), you can do this in Admin > Preferences > Advanced. Suppose you want to use rating from 1 to 5, you can enter the number in the custom field. Call it in an article form with something like:
<img src="/images/<txp:custom_field name="rate" />.gif" />
But keep in mind that if you use the image upload function, Textpattern renames the uploaded images to 1.jpg, 2.gif, etcetera. To avoid confusion, it might be better to name your images ‘one.gif’, ‘two,gif’, …, and enter ‘one’, ‘two’, … in the custom fields.
Offline
#3 2007-01-31 15:35:48
- verum
- Member
- Registered: 2007-01-28
- Posts: 21
Re: Recent Posts - Special Formatting?
That makes sense Els. I had tried using a custom field before, but it was very early on, and for some reason it didn’t work. Now that I know this is what custom fields are for, I’ll give that a shot :)
Many thanks.
Offline
Pages: 1