Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Feedback: Textpattern CMS 4.9.0 released
phiw13 wrote #342109:
valueless
widthandheight, it is not very intuitive.
True. But now, since it defaults to the more sensible least permissive output by default, it’s handy to have a way to say “use the native sizes please” if you really, really want them in the tags for placeholder / space reservation reasons.
Valueless attributes seemed sort of natural for this application, and saves having to manually look up or set the dimensions by hand for each image. You can just add width / height to your tag and it’ll output the right sizes, even if you switch to using a (custom) thumbnail.
I’m still thinking about ditching the public-side access to the config.php thumb size variables, but maybe the crop should remain. Or maybe hard-code it to 1×1 if you don’t specify a value yourself.
That seems a little small. 200px, or same values as you added to theme Hive, seems more appropriate.
200 it is.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Feedback: Textpattern CMS 4.9.0 released
Incidentally, the database sizes will also be triggered if width='' or height=''. They mean the same as valueless BUT that has an interesting ramification:
<txp:article_image thumbnail width='<txp:variable name="my_width" />' />
will behave like this:
1. if my_width has a positive value, the thumb will be displayed at the designated size.
2. if my_width returns nothing, the thumb will be displayed at the database width value (either full size, or thumb size if it’s a custom thumbnail).
3. if my_width returns “0” the width attribute will not appear in the markup and you’ll get the image displayed at native resolution.
The upshot is, if you’re doing this kind of variable-in-attribute thing, ensure you test if the variable exists and has a value before plugging it into an (article_)image or thumbnail tag to avoid any surprises.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Feedback: Textpattern CMS 4.9.0 released
I’ve tweaked the article_image tag output now so that empty image paths are silently skipped.
Also removed references to the config.php variables in the tags so if you specify a valueless crop, you will always get 1×1 square.
Happy to alter this if anyone can think of a better solution.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline