Hello,
here I have a "Casting list" WordPress archive with "Casting" Post Type videos: hidden link
So I already have "Casting" Post Type based on WP category. As you can see, "Kafe" is a Casting's category which contains fields: Number as Post Title, Name, Video, Download single video link.
What I need: I need to insert a new url field at the top of these video's list/archive with a link for downloading all the videos (WeTransfer link) from the same Casting category: hidden link
What I already did:
1. I made another Post Type "Download Videos" with the URL field "Download all videos".
2. I assigned "Casting" categories to the "Download Videos" Post Type: hidden link
So now I can select a "Casting" category for "Download Videos" Post Type.
What I need now:
1. I need ONE Casting category selection to be required. It means that you have to assign One category (ONLY) to the "Download all videos" Post Type. I was trying to do it with Relationships but I couldn't choose ONE to ONE relationship (ONE "Download Videos" to ONE Casting category) because there is no possibility for choosing a WP category type during the Relationship wizard's process.
2. Then I will need to conditionaly display "Download all videos" field at the top of the same category Archive list -as I already explained it at the beginning of my problem. This field is going to be visible if a) it exists and if b) it was assigned to the same Casting category.
_______________
I hope that you will understand my problems' details and you can show/explain me how to solve it. Maybe there is even easier way.
Many thanks for your help and your suggestion.
Best,
Jiri.
Dear Jiri,
In your case, it is possible with Term Field, for example:
1) Dashboard-> Toolset-> Custom Fields-> Term fields,
Here you can setup custom "Download all videos" field in taxonomy "WP category"
2) Edit each term of "WP category", you can setup "Download all videos" field value
3) Edit WordPress Archive page of taxonomy "WP category", you can display the "Download all videos" field value value with shortcode:
[types termmeta="download-all-videos"][/types]
4) And you can display different results by checking above shortcode is empty, for example:
[wpv-conditional if=" ('[types termmeta="download-all-videos"][/types]' eq '')" ]
No download
[/wpv-conditional]
Dear Luo,
many thanks for your explanation,
now I know how to deal with Terms fields and how to place them in Archive page. Great!
But I still need your help with a conditional placement of this field in this case:
1. I need to set a conditional rule for this:
Here you can download all videos: [types termmeta='download-all-videos'][/types]
It means that "Here you can download all videos: link" is going to be visible only if the link exists (it means if the user/editor placed the link in the Casting Category page.
2. I need to open this link in a new window (target="_blank").
Thanks again for your help.
Best,
Jiri.
I'm trying to do it in this way:
[wpv-conditional if="( [types termmeta='download-all-videos'][/types] ne '' )"]
Here you can download all videos: [types termmeta='download-all-videos' target='_blank'][/types]
[/wpv-conditional]
but it is not working.
Thanks again for your help.
Best,
Jiri.
It should be able to work, please provide a test site with the same problem, also point out the problem page URL and wordpress archive page URL, I can setup a demo for you. Private message box enabled.
Thanks for the details, I have done below modifications in your website:
Edit WordPress archive "Casting - video list":
hidden link
in section "Loop Editor", change the shortcodes as below:
[wpv-conditional if="( '[types termmeta='stahnout-vsechna-videa' output="raw"][/types]' ne '' )"]
Here you can download all videos: [types termmeta='stahnout-vsechna-videa' target='_blank'][/types]
[/wpv-conditional]
Please test again, check if it is fixed, thanks
More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#url
‘raw’=Display raw data stored in DB. No other formatting attributes (e.g. custom separator) will be respected.
My issue is resolved now. Thank you!