Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Output custom thumbs at the correct size (pt2)
bici wrote #342225:
[Continued from this topic ]
none of these two options output the correct size image
You need to specify at least a width to get a resized thumbnail. And in the 2nd example, you’re trying to output the ‘t’ version which is a custom thumb. Does it exist? And why the path ../images?
Also, what type of thumbnail is image id 16? Automatic? Custom? None?
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: Output custom thumbs at the correct size (pt2)
bici wrote #342225:
none of these two options output the correct size image:
You have several variants there that all slightly miss the mark.
- The first needs a
width="324to trigger the automatic thumbnail generation. - The second doesn’t use a Textpattern tag and targets a
/images/#t.jpgfile. That could work if your thumbnail is the custom type (e.g. how things have always been in Textpattern prior to the automatic thumbnailing capabiity). For that you need to have “custom” as the thumbnail type and have created a corresponding thumbnail file in the Content › Images panel. - The third likewise doesn’t use a Textpattern tag and targets an image you likely uploaded via FTP in the
/assets/directory.
In short, if you want to use automatic thumbnail generation, what you probably want is:
<txp:permlink class="portfolio__nav__item grid__item one-half medium--one-half wide--one-third is-active">
<txp:article_image width="324" limit="1" class="portfolio__nav__img" />
<txp:title wraptag="h4" class="portfolio__nav__title" />
<txp:category1 wraptag="div" class="portfolio__nav__role" />
</txp:permlink>
or something along those lines. This assumes you have the image id in the article image field and have used Category 1 for your project type classification.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Output custom thumbs at the correct size (pt2)
Thank-you for the tips. but I still think something is counter intuitive. … at least to me
here is my images panel
I have a full size image id 16 which is 968 wide. I have a thumbnail image Custon which is 324 wide. in my images folder on the server there Is a 16t.png file that has a width of 324.
In specifying <txp:thumbnail id="16" /> I would expect that the resulting image would be displayed at 324 wide. But for me that was not the case. The image is output at even a larger width than 968 Adding width to the thumbnail code does nothing.
I wanted to use <txp:thumnial to output 6 different images at 324 wide. And to apply css to them.
I am obviously not getting the concept.
thanks.
I am now moving on to a custom blog section. …
…. texted postive
Offline
Offline
Re: Output custom thumbs at the correct size (pt2)
hmm. if I hand code the the html it works fine.
But using this code in my form results in large images:
<txp:thumbnail id="16" class="portfolio__nav__img" />
view source code:
<!--- another option ================ -->
<img src="https://textism.cal/images/16t.png" alt="" class="portfolio__nav__img" width="324" height="200">
and right-clicking on the large image shows the thumbnail at the correct size.
I wont worry about this for now, but I just mention it as I find it mysterious.
…. texted postive
Offline
Re: Output custom thumbs at the correct size (pt2)
bici wrote #342235:
view source code…
… shows that the sizes are indeed being output as they should, with dimensions, in the HTML. So as Oleg says, the images are likely being rescaled by your CSS. Check the Inspector to see which rules are set.
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