Skip Navigation

[Resolved] Sh

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by justinG-2 5 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1168920

I have two post types - solutions and usages setup in a many to many post relationship.

I have created a view where I am showing details about both post types including the categories they are in and the related posts. So the output on the front end is something like:

Post Title
Categories: Category 1, Category 2, Category 3
Related Solutions: Solution 1, Solution 2, Solution 3,

The list of related posts is produced from a view with a query filter with the options: Select items in the Solution Usages relationship as related items of the current post in the loop.

For the loop I created a content template that simply outputs the title and a comma like this: [wpv-post-title], as there is no option in the query filter to output an array/list of comma separated post titles.

However my issue is that when I display the related solutions a comma appears at the end of the list (as seen above) unlike the categories where an option is given in the dialog box for inserting [wpv-post-taxonomy ] to choose a separator.

Is it possible to use the views conditional shortcode to create a conditional statement that checks if there is one post title not to place a comma but if there is more that one to create a comma separated list?

#1169388

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I see there is a duplicate ticket available. Could you please close this ticket? We will continue with your request with the following tickcet:
=> https://toolset.com/forums/topic/removing-the-last-comma-from-a-comma-separated-list-of-posts-titles-in-views/

#1169712

My apologies, you can delete this ticket if possible as well.