Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
more than one Article Image
I searched but without finding a definitive answer one way or the other.
I want the user to be able to place 2-3 images to each article. I was hoping that one could have multiple
<txp:article_image />
tags.
But i don’t think this is allowed at present.Would love to be proven wrong. Or perhaps there is another user-proof way of accomplishing this?
And somewhat related, if one wants to have each article page have an additional image or two to appear outside the article div …such as in a side bar or under a category list would this have to be done via custom fields? Again the user would be able to add /change the image on a per article basis.
…. texted postive
Offline
Re: more than one Article Image
You could use the excerpt field and set variables for each of the image URLs:
<txp:variable name="image-url-a" value="http://example.com/images/lemon.png" />
<txp:variable name="image-url-b" value="http://example.com/images/grape.png" />
<txp:variable name="image-url-c" value="http://example.com/images/peach.png" />
Edit: typo
Last edited by gaekwad (2014-02-10 18:36:37)
Offline
#3 2014-02-10 20:23:33
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,476
Re: more than one Article Image
Here are several examples in this forum, for example this.
Last edited by GugUser (2014-02-10 20:26:20)
Offline
Re: more than one Article Image
You can put a comma seperated list of image ids in the article image field and use <txp:images/>
to output them. There are plugins to allow picking multiple images.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#5 2014-02-10 21:17:55
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,476
Re: more than one Article Image
MattD wrote #278777:
You can put a comma seperated list of image ids in the article image field and use
<txp:images/>
to output them.
That shows one of my examples (above).
Offline
#6 2014-02-10 21:22:22
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,476
Re: more than one Article Image
bici wrote #278764:
And somewhat related, if one wants to have each article page have an additional image or two to appear outside the article div …such as in a side bar or under a category list would this have to be done via custom fields? Again the user would be able to add /change the image on a per article basis.
In this context a solution is create a macro with smd_macro. So you have an own tag, which you can use where you want. The images on this blog were inserted this way or by using a comma separated image list in the article image field.
Last edited by GugUser (2014-02-10 21:28:11)
Offline
Offline
Re: more than one Article Image
GugUser wrote #278781:
MattD wrote #278777:
That shows one of my examples (above).
Sorry GugUser, I think I started replying before your reply was posted, then got distracted and took for ever to hit submit.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#9 2014-02-11 01:12:46
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,476
Re: more than one Article Image
No problem, it was only a supplementary comment.
Offline
Re: more than one Article Image
bici wrote #278764:
I searched but without finding a definitive answer one way or the other.
I want the user to be able to place 2-3 images to each article. I was hoping that one could have multiple
<txp:article_image />...
tags.
But i don’t think this is allowed at present.Would love to be proven wrong. Or perhaps there is another user-proof way of accomplishing this?
This is undocumented but it was mentioned a lot of times in this forum. The article image field can currently hold more than one comma separated id which can be called with
<txp:images id='<txp:custom_field name="article_image"/>' wraptag="ul" break="li" class="some class" limit="3"><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
Re: more than one Article Image
As colak mentions in his method above, its undocumented but mentioned several times. There are a few other tips to check, and the method above is outlined here.
Offline
#12 2021-02-01 06:06:42
- marios2
- Member
- From: Germany
- Registered: 2019-07-31
- Posts: 76
Re: more than one Article Image
reminder,….
…this is a bookmark post,
rgrds, marios
Offline
Pages: 1