Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Make the exclude attribute global
etc wrote #340095:
Done, please test. It does not handle
sizeattribute atm, but this can be added if necessary.
Nice! I’ll try to play with it tomorrow or so.
I’m not quite happy with leading dots in
extension=".jpg, .png". Should we allow also dotlessextension="jpg, png"syntax, for readability?
If that can be done, here are 10+ votes for dotless syntax, it reads just a more easily.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Make the exclude attribute global
This seem sto work quite well in my basic tests – exclude="'<txp:custom_field name="article_image"/>" and exclude="category-name". Thank you for that.
etc wrote #340095:
I’m not quite happy with leading dots in
extension=".jpg, .png". Should we allow also dotlessextension="jpg, png"syntax, for readability?
I see you’ve now implemented the dotless syntax for extension. That is great (but untested yet). Also implemented if I understand the code is exclusion based on size. How does that work exactly?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Make the exclude attribute global
phiw13 wrote #340121:
This seem sto work quite well in my basic tests –
exclude='<txp:custom_field name="article_image" />'andexclude="category-name".
Only numeric image ids can be excluded directly, so exclude="1,2,3" or exclude='<txp:custom_field name="article_image"/>' is ok. But exclude="category-name" should not work at all, you must combine two attributes: category="category-name" exclude="category".
I see you’ve now implemented the dotless syntax for extension. That is great (but untested yet). Also implemented if I understand the code is exclusion based on
size. How does that work exactly?
Exactly like categories, and you can mix multiple filters:
<txp:images category="category-name" extension="webp" size="portrait" exclude="1, 2, 3, category, size" />
will output all .webp images excluding these of category-name, portraits and ids 1,2,3, iirc.
Offline
Re: Make the exclude attribute global
etc wrote #340124:
[…] you must combine two attributes:
category="category-name" exclude="category".
Yes, that is what I have in my test page. For ID, I was playing with something that is part of a shortcode snippet, so reusable. without knowing ID’s in advance.
Exactly like categories, and you can mix multiple filters:
<txp:images category="category-name" extension="webp" size="portrait" exclude="1, 2, 3, category, size" />...will output all
.webpimages excluding these ofcategory-name, portraits and ids1,2,3, iirc.
Ok, I see. I’ll play without those later. Thank you.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline