Skip Navigation

[Resolved] Display just first value of a RFG on archive, and all values in CPT

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by kasiaK 1 year, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#2606733

Tell us what you are trying to do? I would like to use a repeatable field group to manage location phone numbers like I am using an RGF to manage varying hours of all location. The issue is that I would like to display only the first value of the RFP in the Archive, for example a "main phone number", and then on the CPT display all other associated numbers, for example, Toll free, fax, and any additional special contact phone numbers related to the location, ie an after-hours phone number or a specific department phone number. To keep the archive looking clean just the main phone being displayed would look nice. But when web user clicks through for more information, they can see all the additional numbers associated with the location. Using a table I can neatly display the phone number type and icon, along with the corresponding value.

While I can split up the fields and have a main number, and then a RFG for all the other numbers, I think for the end administratrator of the site who will be managing info daily, it would be cleaner to just have all phone numbers managed under a repeatable group., like the hours..

Is there any documentation that you are following? No. I researched and didn't see any previous users with this question, nor documentation to achieve

Is there a similar example that we can see? this is a work in progress. the archive:
hidden link

a unique case with multiple numbers in the location CPT:

hidden link

currently the additional numbers are in the body, and displayed via a fields and text.

What is the link to your site? hidden link

#2606893

Hello,

It needs a post view, see below sandbox website:
Login URL: hidden link

1) Create a post view:
hidden link
- Query your custom repeatable field group
- Filter by:
Select items from the YOUR-RFG group that are a related to the current post in the loop.
- Display 1 item
- Sort the result by custom field "toolset-post-sortorder"
- In view's loop, display RFG item information

2) In the WordPress Archive, display above post view's shortcode
hidden link

See the result in frontend:
hidden link

For your reference.

More help:
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/

#2607175

Creating a post view is very difficult. Where do you even get to that screen? Using block editor I don't see how to add a post view in the dashboard. Do I need to install views? I thought some of those were deprecated and no longer in use.

I have decided at any rate to just use a work around.

#2607269

Can i install toolset views and not just rely on toolset blocks? and not crash my site.

#2607297

No, you just need to use Toolset Blocks plugin, you can follow our document to enable classic editor and create the post view:
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

Toolset Views plugin was moved to legacy plugins, I suggest you use Toolset Blocks plugin, you can use legacy view with Toolset Blocks plugin

#2609057

My issue is resolved now. Thank you!