Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Random image on article's list (like article_image)
Imaging i assigned two or more images to article (i mean i entered ids of images to textarea at article edit page). How can i output one of them randomly on page with articles list like article_image
tag works? But article_image displays works only with one image…
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: Random image on article's list (like article_image)
would this help?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Random image on article's list (like article_image)
dru_random_image and mem_randimg will select a random image by category, but to my knowledge not out of the list of article images (do correct me if I’m wrong). I briefly looked at other plug-ins like wet_for_each_image (v. powerful but for whole image collections) and wet_thumbfilter (will do lists of article images from several articles but as far as I can see not within an article). More article plug-ins available are listed on textpattern resources.
For building lists of article_images and article_thumbs I always found hak_article_image most useful. It already has attributes such as offset to not start with the first image in the list or do multiple-column lists, so I can imagine it would not be difficult to build in/hack a sortorder or random attribute to hak_article_image which you could then fill with sortorder="rand()"
— or perhaps more simply random="y"
as other sort orders aren’t really relevant for images. If you can’t do it yourself, maybe it’s worth asking hakjoon for that.
Then again, maybe there’s an easier way?
TXP Builders – finely-crafted code, design and txp
Offline