Skip Navigation

[Gelöst] wpv-for-each with url field

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
How to retrieve a multi instance file field with the wpv-for-each shortcode and the exact way to write it?

Solution:
Create Nested Views (Views Inside Views) as explained in this doc:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

And example shortcode here: https://toolset.com/forums/topic/wpv-for-each-with-url-field/#post-505475

This support ticket is created vor 7 Jahren, 7 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

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

Zuletzt aktualisiert von Pat vor 7 Jahren, 7 Monaten.

Assistiert von: Noman.

Author
Artikel
#505186

Pat

Hello,

I have a repeating field (fichier-cheval) that belongs to a parent which can have multiple instances.
I'm trying to display it with this code :

[wpv-for-each field="wpcf-fichier-cheval" id='$chevaux-concours']
FICHIER
[/wpv-for-each]

But nothing is displayed.

If I'm using this code instead,

[types field='fichier-cheval' id='$chevaux-concours' separator=''][/types]

Then, the url is displayed but without link, so we cannot access to the files !
How can I display all instances of a parent url multiple field with a link?
Regards
Pat

#505223

Noman
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hi Pat,

Thank you for getting in touch with us.

1. What is the field type of your Custom field: fichier-cheval (for example file, URL etc )?

2. Can you please provide step by step details that how you have created a View? (preferably with back-end screenshots)

- What you expected to see on the front page?
- What you actually see right now ((preferably with front-end screenshot or Link)

3. Can you please share your Debug Information with us so we can see it? I have enabled debug info box for your next reply:
https://toolset.com/faq/provide-debug-information-faster-support/

Looking forward to help you.
Thank you

#505243

Pat

Hi Noman,
The field is a file field. It is part of a parent (chevaux-concours) of the postype (inscription) I'm listing with my current Views.
I'm expected to see a link with the possibility to click and be redirected to the url page.
Currently, I can see the list of urls by using only this code :
[types field='fichier-cheval' id='$chevaux-concours' separator=''][/types]
But these are only text urls and not able to be clicked.

Best for me would be to have a button for each file that have been uploaded and to render this button into a Views (that's what I tried with my first code using wpv-for-each see above.

Regards
Pat

#505304

Noman
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hello Pat,

1. As I asked earlier, can you please share your Debug Information with us so we can see it? I have enabled debug info box for your next reply:
https://toolset.com/faq/provide-debug-information-faster-support/

2. To debug this issue I will need to take a look at your setup. So I need to request temporary access (WP-Admin) to your site
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please add the Link to the [View] Edit Screen, [Page] Edit Screen where you have inserted this View.

Looking forward to help you.
Thank you

#505375

Noman
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hello Pat,

I have tried to create same setup as you have but I am unable to create the same, it has some confusions and not easy enough to create without proper goal set.

As we have requested couple of times before that we need to see the Views, page links, etc… before we can suggest something. However, at this point I feel we do need site access so that we can analyze, test and produce something useful in your environment. This will save all of our time and keep us on the same page.

- I will need to take a look at your setup. Can you please copy the site to a Test folder (staging site) and provide me its WP-Admin access? – in order to be of better help and check if some configurations might need to be changed.

- Alternatively, you can send us Duplicator package files of your site using the Duplicator plugin for testing purpose, and we will try to check this issue further locally: https://toolset.com/faq/provide-supporters-copy-site/

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ Please add the Links to the [Post Types (parent, child), Views, Pages] Edit Screens & link of the page where this View is displayed.

Looking forward to help you further. Thank you

#505449

Noman
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hello Pat,

I understand your concern but you can exclude files (images, videos, zip files etc) and data using filters in Duplicator when trying to create a package. Even if I have a way to reach out our developers in this fashion they will return me back to have a duplicator package or have an access to a test site where we can see EXACT same setup and debug freely.

What I found during my tests that it may be not possible because the View Loop is run on the fields of current selected post-type in this case is Child Post Type. Trying a different approach can help, which is by creating Nested Views (Views Inside Views) as explained in this doc:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

Without having access or way to look into your setup somehow, it's almost impossible for us to help properly. Alternatively, you can work out in private with a dedicated toolset service provider and we have some recommended list of service providers here if you would like to take a look: https://toolset.com/consultant/

Thank you

#505470

Pat

Hi Noman,

I think nested Views could be a good solution.
Can you explain how I can list the multi-instance of a field within a loop?
I've tried to place the custom field in the loop, but this is not working.

Regards
Pat

#505475

Pat

Hi Noman,
Sorry for my quick previews answer.
I have digged a little more and found the solution to place in the nested Views :

[wpv-for-each field="wpcf-fichier-cheval"]
FICHIER
[/wpv-for-each]
Thanks for your time.
Regards
Pat