Tell us what you are trying to do?
I created 2 views:
a) A view with a list of laws and their features (see image 1, with filter section). Each law is assigned to different customers, depending on the kind of company and activity of customers. So customers can - using the front end filter - select those laws, which are assigned to them. This view has been elaborated using legacy views.
b) A view containg news about legal changes. Here, news are assigned to branches (not individual companies), and customers can select with the frontend filter "branches" =(economic sectors) those news, which are relevant to them. This view has been elaborated using the block editor.
The users i.e. customers should see only their own information in both cases a) and b). There is a way to implement this by using the plugin AAM: In this plugin, I defined terms for the organization as a user-role (view a), and terms for the branch (view b) as a user role. By appling a very selective access control to posts and taxonomies, customers will see only their contents, all other information will be hidden. Example:
Customer ABA has a user-role in AAM plugin as "aba" and he belongs to the branch APH (= homes for elderly people). That's the side of access control in AAM plugin. In Toolset, I defined the terms for the organisations as taxonomy using a short name of the organisation and exactly the same as the one defined in AAM plugin. The same was done for the branches, which are also defined as a taxonomy in Toolset.
So far, so good, If user ABA logs in and goes to the list of laws, the entire view will be loaded with ALL laws (image 2, 1'960 posts). The customer can click on the checkbox containing his term of the front end filter (see image 3) and the laws assigned to him will be displayed. The advantage of this approach is, that the customers can switch between 'all laws' and 'the restricted laws belonging to his company". The big disadvantage of this approach is, that first the entire view with almost 2'000 laws is loaded, which takes some time. Selecting the laws which are relevant for his company will result in about 200-300 laws.
So I would prefer, that their is dynamic preselction of the laws, depending on the logged-in user / customer. In this way, the loading of the view would be much faster, and the user does not have to select his own checkbox. He will just see his own laws and nothing else.
I I am wondering how to achieve this approach. Waqar proposed me a code for filtering the posts / laws, which could be modified towards a dynamic control
https://toolset.com/forums/topic/nested-views-with-block-editor/?bbp_reply_to=1901503&_wpnonce=a5bcf02a0c#new-post
I found also some support information about the get term function which has the same aim as filtering, if I am not wrong
// https://toolset.com/forums/topic/show-only-terms-created-by-current-user-in-taxonomy-dropdown-on-the-form/
but this information concerns toolset forms ...
So what I would like to do is: if user ABA with the user-role 'aba' logs in the system and tries to access the list of laws, then the view will only load the laws which are assigned to the taxonomy term 'aba'. Is their a way to do that?
Franz
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site?