Tell us what you are trying to do?
I am trying to display a View that has only 1 field in a Repeater Field Group. However, what I am seeing on the frontend are:
1.) An extra values that shouldn't be there.
2.) An extra character (eg. $) that should not be there. It's as if it's looping twice, even though there is only 1 value.
hidden link
One thing to note: Prior to some of these fields being placed inside the Repeater Field Group, I had added some values to it, and had saved it.
Later on, I realized I needed them to be inside a Repeater Field Group, and moved it in. So, now it seems like that may have some kind of conflict?
What is the link to your site?
Login: hidden link
Link to URL with issue: hidden link
Link to Oxy Template: hidden link
Example View(s): hidden link
Link to Backend CPT record edit page: hidden link
Hi, I think the issue is indeed that the custom fields were originally saved on the Software post instead of in the RFG, and also that the View is showing results from the Software post itself, rather than the desired RFG fields. To solve that, you should change the settings in View #164 - Field - Deal Price > 1 Code from Software CPT (related to Inserted View). Uncheck the Software post type in the Content Selection settings, since you don't want to include results from the Software CPT itself. Instead, you only want to show fields from the Repeating Field Group (RFG) Software Deal Codes, so leave the RFG selected here.
Then I would change the settings in the post relationship Query Filter so that the relationship is set by the post where this View is displayed. This means that only RFGs from the current Software post will be displayed in this Software post single page. Use the Limit settings to apply a limit of 1 here, so that only one of the RFGs is displayed in this part of the results. To ensure the correct RFG (1 code) is displayed instead of one of the other RFGs, apply an Ordering setting based on Field - toolset-post-sortorder as a number, ascending. This means the order of RFGs you set in the main Software post will be respected by the nested View, and the first RFG (1 code) will be displayed in the results here. Screenshot attached showing a similar setup. If you cannot see the Order or Limit options, you may need to scroll up to the top right corner of the editor page and click "Screen options", where you can activate different configuration panels in the editor. The catch here is that you must apply the same RFG sort order in all Software posts, so that the 1 code RFG is first in the list of all RFGs.
If you'd like to remove the old custom field values from the Software post itself, you may need to use a database tool like PHPMyAdmin to edit the postmeta table and manually delete the postmeta values for these fields that were previously stored for the Software post. You could search the postmeta table by the post ID column, find the results for this Software post ID, and delete the rows corresponding to the meta_keys for the corresponding custom fields.
Let me know if I've misunderstood the problem, or if the solution presented here isn't effective.
Hi Christian,
Thank you! That is great - I followed your instructions on the first part and it was resolved. Now, in re: to removing old custom field values. Should I delete the row/record?
hidden link
Essentially, I just want to make sure that deleting the row in the DB associated with the Post ID should be okay.
Issue #2 - if you feel it should be split into a different ticket, please let me know and I'm happy to do so.
Essentially, I have a Repeater Field Group inside another Repeater Field Group (e.g. Nested RFGs) and I cannot get the fields of the child RFG to display.
Here is the Query Filters for the View, did I misconfigure something?
Link: hidden link
Question #3 - Do you know of there any instructions I can follow on how to display a looped list in a View with Font Awesome icons, custom icons, and/or custom SVGs?
Thank you!
Essentially, I just want to make sure that deleting the row in the DB associated with the Post ID should be okay.
Yes, to be completely correct you should delete the entire row corresponding to each custom field rather than just deleting the meta_value. You should do that for every Software post ID where you initially stored a custom field value directly in the Software post before moving the custom fields into an RFG.
"I don't know which one is the repeater field and which one is not"
You should only delete the rows that correspond to Software post IDs. In your example, 55 is a Software post ID, as you showed in the video by editing one of the Software posts and comparing the post ID from the URL. So if you want to be sure you are only deleting the items that were originally from Software posts and not repeater fields, you could go to wp-admin > Software and get all the Software post IDs from that list, or you could go to the wp_posts table in your database and sort by post_type = 'software' or whatever the Software post type slug is. That would help you find a list of all Software post IDs. Only delete the postmeta table rows where the meta_key corresponds to the desired custom field slug, and the post_id corresponds to Software post IDs. The other rows must be repeater field group entries, so you should not delete those from the DB. If you happen to delete a repeater field row from the DB mistakenly, that custom field will simply appear blank in the Software post editor screen's RFG editors. No problem, just add the desired value back in the RFG editor. If I understand correctly you're just making up numbers now anyway as a test.
Essentially, I have a Repeater Field Group inside another Repeater Field Group (e.g. Nested RFGs) and I cannot get the fields of the child RFG to display.
Question #3 - Do you know of there any instructions I can follow on how to display a looped list in a View with Font Awesome icons, custom icons, and/or custom SVGs?
Let's address these in a separate ticket. You'll need a nested View structure here if I understand the setup correctly. I see one View in your Video - a View of the outer RFG. To display the nested bullets RFG, you'll need a nested View of the inner, bullets RFG displayed inside the View of the outer RFG. I've split off a new ticket where we can discuss in more detail.
Hi Christian,
Thank you for the message, following your instructions, I have deleted the row from the DB where ID = '55'.
hidden link
However, I am seeing a scenario where I have 2 Views with similar query filters, and one of them is returning the correct RFG field, while the other just displays the CPT link.
Please see video here for what I mean: hidden link
I'm not able to hear the audio for the most recent video, and I'm not really clear about what's going on. Do you want to provide more information in text, or provide another video with descriptive audio?
Hi Christian,
So sorry! Here is a better version with audio: hidden link
Please let me know if this was more helpful. Thank you! 🙂
Okay I understand better now, thank you. The difference between these two Views lies in where the Types field shortcode is placed, which effects the context of the shortcode. In the first example you shared, the field shortcode is included outside the wpv-loop tags in the Loop Editor. This means the context for that shortcode is the same as the context where the View is displayed, i.e. the Software post itself. The context should not be the Software post, but the looped RFG posts. Hence the shortcode returns nothing, and the link href is essentially blank, which results in a link to the same page. If you move the Types field shortcode inside the wpv-loop tags, or inside the loop template below the Loop Editor, the context of the shortcode should be correct - i.e. the looped RFGs. That would result in the correct link href being rendered.
In the second example you shared, the Types field shortcode is placed inside the loop template, which is then inserted in the wpv-loop tags. So the context of the Types field shortcode in this case is the looped RFG. That's the correct context, so the link appears as expected.
My issue is resolved now. Thank you Christian!