Switching template when filtering
-
Hi again,
I have a pod for a business directory where people are listed by name, their photo, company, address etc. – and also there are categories for the different industries.
Now I have a template for an alphabetical list for these people where you can look at all the names and photos and click on them to see their details. I also have a filter for the industries, so that you can filter and only see the names of people in these industries.
Now there are some people in this directory who own more than one company – hence they have more than one entry. It was a bit strange to see their photos repeated – so I added some more fields to the pod to indicate whether this is an additional entry, or if this is the main entry. Also a relationship field which can select the other profiles from the same name, so on the detail page you can see which other companies this person has. Then I modified the pod template, so it will only ignore the entries with have a “yes” in the field “additional entry”. This works fine, it now lists only the main company, so every profile picture is only there once and you can find the other companies by clicking on the profile of the main entry.
However I have now a problem with the filtering…. when I filter for industries, the additional entries will obviously not show. They would however show if I used the previous template, which ignores the “additional entry” field.
Is there any clever way I could change the template, whenever somebody clicks on the “Select” button to filter for an industry? So, if you first clicked on the page with the alphabetical listing, you see the template without the duplicates – and as soon as you filter, you see the other template which shows all entries regardless whether they are main entries or duplicates.
Hope I have explained well enough…
Thanks!
The topic ‘Switching template when filtering’ is closed to new replies.