Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-11-02 03:14:14

code365
Member
From: California
Registered: 2009-08-16
Posts: 110
Website

Categories Images

Hi,

I am trying to figure out how to pull each image folders from the categories. I looked through the documentation on <txp:images/>and <txp:image/>, still not able to pull the category images from each folder. Can someone help me please or point me where to get abetter understanding. Thank you

Folder-name-a (images)
Folder-name-b (images)

This does not works with category

<txp:images category='<txp:category />' >
 <txp:image />
 </txp:images>

This works with a single category name

<txp:images category='landscape-image' >
 <txp:image />
 </txp:images>

Last edited by code365 (2020-11-02 03:47:18)

Offline

#2 2020-11-02 05:02:27

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

Re: Categories Images

Your first example will work if the article category is the same as the image category

The second example will work anywhere but double-quotes are advised:

<txp:images category="landscape-image">
<txp:image />
</txp:images>

What I do not understand is your question about folders. txp does not create any folders for 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

#3 2020-11-02 05:57:17

code365
Member
From: California
Registered: 2009-08-16
Posts: 110
Website

Re: Categories Images

When you go to content->categories->images section, you have to type a name to create a new category. Maybe I am not using the right term, but it create a new category list in the images column. I am trying to have the category return a lists.

category-a
category-b
category-c

Last edited by code365 (2020-11-02 06:05:21)

Offline

#4 2020-11-02 06:10:54

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: Categories Images

I’m not sure what you’re trying to accomplish. Do you want to display every image from every image category?


Prrrrrrrr

Offline

#5 2020-11-02 06:36:12

code365
Member
From: California
Registered: 2009-08-16
Posts: 110
Website

Re: Categories Images

Yes, every image category with an image from each list.

Last edited by code365 (2020-11-02 06:43:00)

Offline

#6 2020-11-02 07:31:22

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: Categories Images

I think you manually have to type every category name then, separated by a comma:

<txp:images category="category-a, category-b, category-c">
<txp:image />
</txp:images>

Prrrrrrrr

Offline

#7 2020-11-02 09:13:14

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Categories Images

You can try this

<txp:images category='<txp:category_list type="image" break="," />'>
    <txp:image />
</txp:images>

or this

<txp:category_list type="image" break="">
    <txp:category title wraptag="h3" />
    <txp:images category='<txp:category />'>
        <txp:image />
    </txp:images>
</txp:category_list>

Offline

#8 2020-11-02 13:13:59

code365
Member
From: California
Registered: 2009-08-16
Posts: 110
Website

Re: Categories Images

Thank you for your time and help etc. So category_list and category are global tag.

Last edited by code365 (2020-11-04 03:14:46)

Offline

Board footer

Powered by FluxBB