Hi,
I have a complex Archive view, calling nested views and content template.
The main view is hidden link and is used for every "Formations" taxonomies.
When loading a term page (for instance hidden link), I have the expected results (1. a map of Institutes, then 2. a list of Formations).
I then can edit the dynamic filters and I still get the expected results : for instance I can add the Domaine "Agriculture" and it displays 1. the map of Institutes with children Agriculture Formations, then 2. the list of all Agriculture Formations themselves.
But if I delete that "Agriculture" filter, it now displays 1. the expected map of institutes, then 2. the institutes descriptions, and last 3. the formations themselves.
I don't need the Institutes descriptions to display there.
It may be a problem with this content template hidden link, where I set this condition before the institutes descriptions :
[wpv-conditional if="( is_post_type_archive('formation', null) eq '0' ) AND ( is_tax('niveau', null) eq '0' ) AND ( is_tax('domaine', null) eq '0' ) AND ( is_tax('ville', null) eq '0' ) AND ( is_tax('type-de-formation', null) eq '0' )"]
Meaning this description should only appear if the current page is NOT a formation post type archive.
Problem is precisely that the page hidden link IS a formation post type archive, so this content should never display, not on loading the page, nor when editing the filters.
Thank you.
Hello and thank you for contacting the Toolset support.
I can see the issue, once we remove the filter on domains, the view displays the list of establishments. I'll need to access the backend as an administrator to be able to debug this issue further. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
As you said, it seems that the following condition does not work correctly on this case:
[wpv-conditional if="( is_post_type_archive('formation', null) eq '0' ) AND ( is_tax('niveau', null) eq '0' ) AND ( is_tax('domaine', null) eq '0' ) AND ( is_tax('ville', null) eq '0' ) AND ( is_tax('type-de-formation', null) eq '0' )"]
Maybe because it was an AJAX call, but why did it not evaluate the same for the first AJAX call(choosing Agriculture in Domains).
As a workaround, I added a class to the content template, and custom code to hide it for archive pages. Check it here hidden link
body.archive .ts-no-tax {
display: none;
}
But, I wonder, why are you using the "Infos sur cet établissement" view, which is using this content template, inside of an archive template?
Thank you ; this work indeed, but that avoid the list of Institutes to display on Institutes taxonomy pages, as for instance hidden link (where the list should display because we are on a term related to Institutes)
Thank you.
WordPress adds some CSS classes to the body of each page. Taxonomy archives get some classes such as "archive" and "tax-{taxonomy-slug}". In the first CSS that I shared, I used the class "archive". But, as you want the content template to be visible for the taxonomy "Localités", we'll need to use "tax-{taxonomy-slug}" classes instead. The custom code will then be:
/* Taxonomy Villes */
body.tax-ville .ts-no-tax {
display: none;
}
/* Taxonomy Domaines */
body.tax-domaine .ts-no-tax {
display: none;
}
/* Taxonomy Niveaux */
body.tax-niveau .ts-no-tax {
display: none;
}
/* Taxonomy Types de Formations */
body.tax-type-de-formation .ts-no-tax {
display: none;
}
Or in one CSS rule:
body.tax-ville .ts-no-tax,
body.tax-domaine .ts-no-tax,
body.tax-niveau .ts-no-tax,
body.tax-type-de-formation .ts-no-tax {
display: none;
}
I used the last code in the content template and it is working. The archive for the taxonomy "Localités" displays the content template hidden link
Thank you. This works now for Localités taxonomy too. But if still doesn't for the main "Etablissements" archive hidden link
Thank you.
Can you elaborate more on what's not working for the Etablissements archive?
Not sure why or how but My issue is resolved now. Thank you!