Navigation überspringen

[Gelöst] All values of a custom fields of al post do show up in one post. What is wrong?

This support ticket is created vor 5 Jahren, 1 Monat. 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Dieses Thema enthält 5 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von martinP-14 vor 5 Jahren, 1 Monat.

Assistiert von: Christian Cox.

Author
Artikel
#1390115

Hi,
I have created a CPT with a group of custom post fields. On of the fields is "URLs" and can be added mutiple tomes to the CPT. Nw I tried to create a view integrated in a template for the CPT. Unfortunately all "URLs" of all CPT posts doe show up in each of the single post of the CPT.

What do I wrong? How can I limit the URLs to the one from the CPT post?

I scanned the documentation but did not find my case....

Kind regards, Martin

#1390117

I saw tat not a view is needed but that I can select the CPF in the template itself. But here I get a comma-seperated list.Hwo can i make

    -list?.
#1390467

Hi, I just found this:

https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/

But the section with the fields below of the post types is not shown anymore! Video seems to show an older Toolset-Version, right? So there must be another way.

#1390473

So, now I know what I stumble about! Sorry for this updated question... what I found out:

There are repeatable field groups (Video) and e. g. single line where you can check that multiple instances can get filled in.

I learned the earlier can get designed via a view and yes, the group show up now after I found this „other“ field type.

The later gets displayed in a template just by adding the field where multiple instances can get separated by a comma et. al.

So now my questions are:

1: can the later get styled different just by a separator? More like in a view with a loop?

2: or is this possible and I habe to choose before how to add a field with multiple instances if I later want to just list it separated by a separator or if I want to style it more complex?

3. what is the difference between these two options to add a field with multiple instances?

Kind regards, Martin

#1390567

1: can the later get styled different just by a separator? More like in a view with a loop?
No, Views is not designed to loop over repeating custom fields like this. If you want a more complex template for each item, the repeatable field group (RFG) approach is best. Or, you could use custom PHP code to write your own loop and template.

2: or is this possible and I habe to choose before how to add a field with multiple instances if I later want to just list it separated by a separator or if I want to style it more complex?
Yes, it's best to decide in advance how you want to display the list of instances. If you want a more complex template for each item in the list, a RFG is best. Otherwise, you need custom code.

3. what is the difference between these two options to add a field with multiple instances?
A repeatable field group (RFG) works more like a custom post type, and supports more than one custom field in each instance. For example, in an RFG you could include a URL field and two text fields, so you can create a custom link with a URL, custom text, and an "alt" attribute like this:

<a href="[types field='url' output='raw'][/types]" alt="[types field='alt' output='raw'][/types]">[types field='link-text' output='raw'][/types]</a>

A field that allows multiple instances does not allow more than one custom field per instance, so you could not include custom text to display in the link or a custom "alt" attribute. Each URL could not be linked to other custom field information effectively.

A RFG is also easy to display with Views, but a repeating image field is not.

#1391293

My issue is resolved now. Thank you!