Skip Navigation

[Resolved] Multiple Download URL Dropdown Setup

This thread is resolved. Here is a description of the problem and solution.

Problem:

Sort the custom repeatable field groups by custom order.

Solution:

You can follow our document to setup a post view to query the items of repeatable field groups:

Relevant Documentation:

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

This support ticket is created 4 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
- 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 6 replies, has 2 voices.

Last updated by columD 4 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1527675
703a01463a52562b58f959e635995d77.png

Hi,

What is the best way to set up a multiple download URL dropdown? (See Attached)

I would like to create a post type called "Case Study", and add a download button with a dropdown of the available language people can download.

Is setting up a URL field for each language the best way to go about this?

If I have 3 languages but 1 case study is only available in English. Would they still see Chinese&Japanese in the dropdown?

I only want the links to show up only if the URL link is available.

Thanks!

#1528133

Hello,

I assume we are talking about WPML plugins, and you are using WPML plugin to translate your website, I suggest you follow WPML document to setup the language switcher:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/

In your case, you can try option "Skip language", see the screenshot in above document:
hidden link

#1528771
1a01311adaca591f7ec8c5d769787147.png

Hi Luo,

My website will be auto-translated.

Let's not use the language since it might be confused.

Let's say I want to add a Case Study to have a download button with the ability to download the previous version.

Is setting up a URL field for each language the best way to go about this?

If I have 3 fields set up but 1 case study only has one version. Would they still see the dropdown for Verison 2 & 3?

Thanks,
Bonnie

#1528907

So I've set up the download links as repeatable fields.

What is the best way to link the URL to the text?

Something like this:
<div class="dropdown">
<button type="button">
Download
</button>
<div class="dropdown-menu">
[types field="language"][/types]
[types field="language"][/types]
[types field="language"][/types]
</div>
</div>

#1529075
ef24ec8bc973bc99926f178c33fb9548.png
4371a991f34082768c35d73bce39536e.png
cc6f8d232e89ba82a330a726addbf3a2.png

Hello,

I just want to follow up, I was able to set up a dropdown successfully.

I am stuck on a sorting issue.

Are there any ways to sort by the order they are placed on the backend on each post?

If not, I would like English to always be top and then sort alphabetically. (By Default)

Right now it's being sorted by the "Custom field content" which works technically as you can see I've added 1-5, but If I add more languages in between it might cause issues down the road. Option 1 would be to add English 1 as then separate by an increment of 10. The next language would be 10, 20, 30, 40. so That way I can always add more languages in between alphabetically.

Are there any ways to customized based on the placement on the page's backend? Sort freely anytime.

Thanks!

#1529839

I assume we are talking about a custom repeatable field groups.

If it is, please follow our document to setup a post view to query the items of repeatable field groups:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

You can oder the result by "Field – toolset-post-sortorder", see screenshot in above document:
https://toolset.com/wp-content/uploads/2019/11/repeatable-field-group-custom-order.png

#1536051

The instruction of the article is dated but I was able to find the sorting option by editing the view block.