Thanks for the details, I can see problem A) AND B) in your website, and have done below modifications in your website, edit the post view "Liste des domaines de formation de cet établissement", in section:
Change the codes from:
[wpv-layout-start]
[wpv-items-found]
<hr>
<h2>Domaines de formation<span class="seo-friendly"> de cet établissement</span></h2>
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=other]
[wpv-post-taxonomy type="domaine" format="link" separator=","],
[wpv-item index=last]
[wpv-post-taxonomy type="domaine" format="link" separator=","]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
To:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>[wpv-item index=other][wpv-post-taxonomy type="domaine" format="link" separator=","],[wpv-item index=last][wpv-post-taxonomy type="domaine" format="link" separator=","]</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
This will remove unrelated contents and blank spaces,
for the problem C, I have changed the PHP codes to:
...
foreach ($view_output_unique as $key => $val) {
if(ctype_space($key)){
continue;
}
$output .= $key.' ('.$val.'), ';
}
...
More help:
hidden link
Please test again, check if they are fixed, thanks
Hello and thank you very much,
This in deed solved most of the problems.
Nevertheless, now I would need to be able to use a conditional display based on the view results.
If the view has no result, then don't display anything.
That doesn't work since as soon as I put something in the [wpv-no-items-found] [/wpv-no-items-found] tags, it displays with the "(1)" on front end.
How may I disable this "(1)" if there is no result ?
Thank you.
You don't need put anything into shortcode [wpv-no-items-found] [/wpv-no-items-found], you can use wpv-conditional shortcode to check that custom shortcode outputs, for example:
1) Dashboard-> Toolset-> Settings-> Front-end Content
in section "Third-party shortcode arguments", add the custom shortcod name: show_related_domaines
2) Add below line into content template "Infos pour établissement":
hidden link
Line 37:
[wpv-conditional if="( '[show_related_domaines view="liste-des-domaines-de-formation-de-cet-etablissement"]' eq '')"] Display something else [/wpv-conditional]
Then test again
Thank you.
I tried this and put my whole conditional code into wpv-conditional without success :
[wpv-conditional if="( '[show_related_domaines view="liste-des-domaines-de-formation-de-cet-etablissement"]' ne '')"]
<hr>
<h2>Domaines de formation<span class="seo-friendly"> de l'établissement</span></h2>
[show_related_domaines view="liste-des-domaines-de-formation-de-cet-etablissement"]
[/wpv-conditional]
[wpv-conditional if="( '[show_related_domaines view="liste-des-domaines-de-formation-de-cet-etablissement"]' eq '')"] Display something else [/wpv-conditional]
The "Display something else" displays alright when view returns no result, but the main code don't display anymore, even if the view returns something.
The wpv-conditional shortcode does not support complicated codes, I have done below modifications in your webiste:
1) Edit the PHP codes, line 94, replace it from:
'view' => '',
To:
'view' => 'liste-des-domaines-de-formation-de-cet-etablissement',
2) Edit the content template "Infos pour établissement", line 34~39, use below codes to display different results:
[wpv-conditional if="( !empty('[show_related_domaines]') )"]
<hr>
<h2>Domaines de formation<span class="seo-friendly"> de l'établissement</span></h2>
[show_related_domaines view="liste-des-domaines-de-formation-de-cet-etablissement"]
[/wpv-conditional]
[wpv-conditional if="( '[show_related_domaines view="liste-des-domaines-de-formation-de-cet-etablissement"]' eq '')"] Display something else [/wpv-conditional]
Please test again, check if it is fixed, thanks
Thank you.
I tried this solution but it doesn't seem to solve the problem: the Etablissement with Formations still don't display anything, where the Etablissement with no Formation still display "Display something else".
Thank you.
I can not edit your PHP codes in admin side any more, I get these errors even click the "Update button" here:
hidden link
Allowed memory size of 536870912 bytes exhausted (tried to allocate 5064008 bytes)
Then I have tried the FTP access you provided:
https://toolset.com/forums/topic/get-terms-from-children-posts/#post-1691265
It is not valid, I can see only an empty folder after login the your FTP access.
Please check it, make sure your FPT access is valid, it needs to modify the PHP codes
Hi,
I've just tested the ftp credentials here https://toolset.com/forums/topic/get-terms-from-children-posts/#post-1691265 and I confirm those work ok.
Thank you.
I have tried the FTP access lots of time, it does not work, I can see an empty folder and error message: Failed to retrieve directory listing
see my screenshot ftp2.JPG
You can also provide a full copy of your website in below private message box, I can test and debug it in my localhost:
https://toolset.com/faq/provide-supporters-copy-site/
Could you please try with a VPN enabled ?
Also please feel free to install an FTP plugin on the site to explore the files directly from WP.
Finally, if it still doesn't work, could you please enable confidential message in order to allow me to give you another access ?
Thank you.
I have tried with VPN, same problem, please provide an valid FTP/SFTP access in below private message box
The new FTP access does not work too, I have done below modifications in your website:
1) Add a custom snippet:
hidden link
It will create a new shortcode [show_related_domaines2], and output the term count as number
2) Edit the content template:
hidden link
line 35~40:
[wpv-conditional if="( '[show_related_domaines2]' gt 0 )"]
<hr>
<h2>Domaines de formation<span class="seo-friendly"> de l'établissement</span></h2>
[show_related_domaines view="liste-des-domaines-de-formation-de-cet-etablissement"]
[/wpv-conditional]
[wpv-conditional if="( '[show_related_domaines2]' eq 0 )"] Display something else [/wpv-conditional]
Use the new shortcode in [wpv-conditional] shortcode.
Test it in front-end:
hidden link
hidden link
Both work fine, please check if it is fixed, thanks
This is awesome, thank you very much!
My issue is resolved now. Thank you!