Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Randomly ordered images permlinked to their respective articles...
gomedia wrote #293456:
I don’t think that’s a problem with what I suggested – it runs on article IDs until the last moment, when a link is output.
Sure, but what you suggest either (with limit="1"
) outputs one image per article, or (without limit
) leaves them grouped by article. That’s not what Stacey wants, and you obtain the same result with
<txp:article_custom sort="rand()">
<txp:if_article_image>
<txp:images sort="rand()">
<txp:permlink><txp:image /></txp:permlink>
</txp:images>
</txp:if_article_image>
</txp:article_custom>
But if you do need a delimiter with adi_list then use
separator="|"
or some such and changedefault_separator
to be something different (it defaults to"|"
).
Good to know, I haven’t found separator
attribute on your site.
Last edited by etc (2015-07-18 08:15:05)
Offline
#14 2015-07-18 09:51:19
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: Randomly ordered images permlinked to their respective articles...
etc wrote #293459:
Sure, but what you suggest either (with
limit="1"
) outputs one image per article, or (withoutlimit
) leaves them grouped by article. That’s not what Stacey wants
Must’ve misunderstood, I thought one random image from one random article was the requirement.
Good to know, I haven’t found
separator
attribute on your site.
I’ll look into that, thanks.
Offline
Re: Randomly ordered images permlinked to their respective articles...
I love it that there are so many different ways to do things. When I first read the question I thought “that’s a tough one”, but our collective input adds more ideas to the pool.
Oleg, you’re right: I had assumed rah_repeat would support sort="rand()"
. Would need trying…
adi_list is another one I’ve overlooked – must try that out sometime.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Randomly ordered images permlinked to their respective articles...
This is something that should be kept on TXP Tips for posterity. But who is the author…?!
Offline
Offline
Re: Randomly ordered images permlinked to their respective articles...
Offline
Re: Randomly ordered images permlinked to their respective articles...
Looks like a good occasion to test your “switch author” plugin, Jonathan. ;)
Offline
Re: Randomly ordered images permlinked to their respective articles...
But who would be the author Oleg..?!!
Offline
Re: Randomly ordered images permlinked to their respective articles...
jstubbs wrote #293492:
But who would be the author Oleg..?!!
I’m not sure if the question is fully answered yet. I’d like to hear from photonomad what code he used and if we can see the result online.
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: Randomly ordered images permlinked to their respective articles...
Take a look at Stacey site, the problem seems solved. I suggest we ask Stacey to write a tip.
Offline