Sat Jun 05, 2004
Random Image Plugin (txp:mem_randimg)
I created a plugin to randomly fetch an image from a list of categories and then populate a form with its values.
file:
mem_randimg.txt [6.57KB]
Category: Textpattern
download: 1960
| Tag (wrap with < and > | Result |
| txp:mem_img | An html img tag that contains alt, height and width for the image. |
| txp:mem_img_url | A url path from the root to the image. |
| txp:mem_img_thumbnail | An html img tag that contains alt, height and width for the image’s thumbnail. |
| txp:mem_img_thumbnail_url | A url path from the root to the thumbnail. |
| txp:mem_img_caption | The image’s caption. |
| txp:mem_img_alt | The specified ALT value for the image. |
| txp:mem_img_category | The image’s category. |
| txp:mem_img_width | The image’s width. |
| txp:mem_img_height | The image’s height. |
| txp:mem_img_author | The name of the image uploader. |
| txp:mem_img_date | The date the image was uploaded. |
Edit 6/23/2004: Added below example form
Url:
Thumbnail:
Url:
Caption:
Alt:
Category:
Width:
Height:
Author:
Date:
Comment
— Marco · 06/20/04 01:25 AM · #
— Oliver Nielsen · 05/08/05 08:00 AM · #
I mean, I put the tag inside an article, and it did work flawlessly.
Now, my question is
Is it “correct”, when possible, to use txp tags inside articles?
or this kind of practice shoud be avoided?
— ManiquÃÂ · 06/13/05 03:36 PM · #
I would like to know if it is possible to use this plugin for pictures in the textpattern css. For example showing random background images …
— Stewart · 05/10/06 07:55 AM · #
I don’t know if your question regarding CSS-background-images has been answered meanwhile, but since I needed the same thing, I found the following solution:
Add an additional style setting within the page template, after the css-importing-tag, which simply defines the background image for any selector you need.
This will overwrite the separate-css-based definition with the randomly generated img-url.
I did it like this (replace [selector] by your selector, e.g. div):
with the form “background” simply containing this tag:
— Michael Schlierbach · 05/19/06 05:43 PM · #
hey manfre, the tag txp:mem_img outputs width/height of image using inline styles… but omits the values which are required! (need to add ‘px’ after the values)
— nardo · 07/23/06 10:29 PM · #
I contacted Michael and try to supply the missing code above.
first part
#head
{
}
#head a, #head a img
{border: 0; text-decoration: none;}
— uli · 08/22/06 09:35 AM · #
second part
< txp:mem_img_url / >
(geeeee, limited text size and no txp tags allowed ;)
— uli · 08/22/06 09:43 AM · #
Commenting is closed for this article.






