Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-02-10 17:54:45

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

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

#2 2014-02-10 18:29:04

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

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,473

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

#4 2014-02-10 20:55:02

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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.


My Plugins

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,473

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,473

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

#7 2014-02-10 22:20:05

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: more than one Article Image

GugUser wrote #278782:

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.

right! thanks for the tip about this macro. i had tried searching for a plugin without success.


…. texted postive

Offline

#8 2014-02-11 00:00:46

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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.


My Plugins

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,473

Re: more than one Article Image

No problem, it was only a supplementary comment.

Offline

#10 2014-02-11 06:26:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

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

#11 2014-02-11 06:43:21

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

Board footer

Powered by FluxBB