Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Topic closed
[archived] bau_article_thumb
Notice: This thread is archived, there are native txp tags now.
**********************************************************
I wasn’t going to post this plugin because it just seemed too simple to warrant a post. However, someone has asked that I make it available, so here is my first plugin.
All it does is output an article thumbnail. I’m really not sure why txp:thumbnail doesn’t appear to work in RC3, but it really didn’t seem necessary with zem_article_thumb, until it broke in one particular instance for some strange reason that I couldn’t figure out.
So, I went back to the txp:article source code to find out how it worked. Basically, it returned the article ID number and added an image url string to locate the image in the default image directory. Since thumbnails are created in Textpattern with the addition of the letter “t”, it was just a simple matter of adding it to the url string.
That’s all it does.
Download plugin: bau_article_thumb-0.2.txt
To see how I’ve used it for a thumbnail gallery, you can see my page template
Edit: Updated 10 Aug 2005 to version 0.2, thanks to Manhog.
Last edited by bauhouse (2005-08-11 23:41:32)
Offline
#2 2005-06-28 20:20:53
- Manhog
- Member
- From: Manchester, UK
- Registered: 2004-03-15
- Posts: 24
Re: [archived] bau_article_thumb
I installed the plugin and it works fine. Many thanks, as this will finally enable me to attach thumbnails to article lists for “news headlines” type stuff.
I’ve also hacked the code, changing all instances of style
to class
.
Which means, for example, I can use the following in my TXP forms:
< txp:bau_article_thumb class = “thumb” />
Which will output:
< img src = “http://localhost:8007/images/1t.jpg” alt = “A lovely car” class=“thumb” />
Which renders a lovely thumbnail floated to the left when using this CSS:
.thumb {
float: left;
margin: 0 10px 10px 0;
border: 2px solid #ccc;
}
Do you want me to send you the amended PHP code?
Offline
Offline
Re: [archived] bau_article_thumb
how would you use this to output the last 5 article images and skipping x number?
thanks in advance
Offline
Re: [archived] bau_article_thumb
You do it with your article tag. Because this plug-in uses article images you have to use it in an article “type” form then in your page template or whatever you call the form using txp:article or txp:article_custom and use the “offset” and “limit” attributes.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: [archived] bau_article_thumb
Manhog, that would be great if you could send the amended PHP code. Sounds like a great addition. Don’t assume that I will understand how you’ve changed the code, because I’m pretty much a newbie when it comes to PHP. This plugin was just an act of desperation, and then came the question, Why hasn’t this been implemented already in the current distribution because it is so basic?
Offline
Re: [archived] bau_article_thumb
Manhog, thanks for sending the amended PHP code. The new version 0.2 is now updated and available for download.
Now someone tell me whether this plugin is necessary, given there have been changes to the standard <txp:thumbnail />
tag. Consult TextBook before deciding on whether to use this plugin or not.
Last edited by bauhouse (2005-08-11 23:47:35)
Offline
Re: [archived] bau_article_thumb
Still not an article_thumbnail though as far as I know.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#9 2005-08-12 00:00:09
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [archived] bau_article_thumb
I just asked for an article_thumb to be standard issue. Thanks for filling the gap.
Offline
Pages: 1
Topic closed