Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2021-02-05 15:04:48
- nobi-wan
- Member
- Registered: 2021-02-05
- Posts: 23
Multiple article images (not thumbnails)
Hello!
In my articles, I want to display all the article’s images in at high-resolution. (txp:article_image/> just does the one of course, and <txp:images/> sounds great but it is displaying linking thumbnails.
I’m on TXP 4.7.3.
Help! Thank you.
Offline
Re: Multiple article images (not thumbnails)
Hello, welcome to the forum. You can try using <txp:images />
as container:
<txp:images>
<txp:image />
</txp:images>
Offline
Re: Multiple article images (not thumbnails)
nobi-wan wrote #328546:
Hello!
In my articles, I want to display all the article’s images in at high-resolution. (txp:article_image/> just does the one of course, and <txp:images/> sounds great but it is displaying linking thumbnails.
I’m on TXP 4.7.3.
Help! Thank you.
Hi and welcome to txp
You can still use article_image.
<txp:images id='<txp:custom_field name="article_image" />'>
<txp:image />
</txp:images>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#4 2021-02-05 16:22:19
- nobi-wan
- Member
- Registered: 2021-02-05
- Posts: 23
Re: Multiple article images (not thumbnails)
colak wrote #328549:
Hi and welcome to txp
You can still use article_image.
<txp:images id='<txp:custom_field name="article_image" />'>...
Colak — thanks, but I tried this previously with great expectations and it still gave me thumbnails.
Etc — thank you! That worked.
(Why isn’t this a simple txp:article_images tag?)
Offline
#5 2021-02-05 16:23:52
- nobi-wan
- Member
- Registered: 2021-02-05
- Posts: 23
Re: Multiple article images (not thumbnails)
etc wrote #328548:
Hello, welcome to the forum. You can try using
<txp:images />
as container:
<txp:images>...
This worked. Thank you etc!
Offline
Offline
Re: Multiple article images (not thumbnails)
nobi-wan wrote #328551:
Why isn’t this a simple txp:article_images tag?
Because historically the article image field could only hold one ID. When we allowed comma-separated lists of images, the tag still retained its roots at handling the first image only.
The <txp:images>
tag was then introduced to provide functionality for accessing all images and its default behaviour is for “gallery” setups, hence it shows thumbnails linked to the full size images.
You need to use the tag with a form or as a container to override the default behaviour, as etc showed in its simplest form.
That said, I would support a limit
attribute for <txp:article_image>
. Makes a lot of sense.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Offline
#9 2021-02-05 16:58:35
- nobi-wan
- Member
- Registered: 2021-02-05
- Posts: 23
Re: Multiple article images (not thumbnails)
etc wrote #328555:
And then
break
too. But we’d have to take care of non-numeric entries, and it then becomes a<txp:images />
clone.
Couldn’t txp:images simply have a boolean for high-res vs thumbnails?
Offline
Offline
Re: Multiple article images (not thumbnails)
nobi-wan wrote #328556:
Couldn’t txp:images simply have a boolean for high-res vs thumbnails?
If you use any of the <txp:... />
tags as single tags, they do ‘best guess’ (read: most used) behaviour. You can customise them to a degree by using attributes to affect what the output does, e.g. using link
in some tags will add an anchor to the content, and wraptag
/ class
will add HTML tags and class
attributes to the default output.
But essentially the ‘container’ is hard-coded based on whatever we deem the most useful output for most users, then customisable based on the attributes you supply. If you want to do anything beyond this ‘most used’ behaviour, you need to use the tag as a container.
For <txp:images>
specifically, a bunch of the attributes filter the output to allow you to choose images based on various physical parameters. The remaining attributes then affect the formatting of the chosen images. thumbnail
is one such attribute used to filter and therefore cannot be used in the manner you describe.
Last edited by Bloke (2021-02-05 17:12:22)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Multiple article images (not thumbnails)
Bloke wrote #328559:
thumbnail
is one such attribute used to filter and therefore cannot be used in the manner you describe.
In single mode, <txp:images thumbnail="0" />
outputs invalid links (since no thumbnail) anyway. We could change it to output all images instead.
Offline