I have the following sites and lists:-
- Department list inside my site collection root site.
- Module List inside a sub-site.
- Each Module item is linked with a department item through a lookup field.
- Now i define an event receiver inside my Module list, which will fire when a module item is added. the event receiver will create a new module sub-site. where the new Module sub-site URL will be equal to the module Item ID.
- now inside the new Module sub-site there is a list named "Tracking" which have a custom content type named "CustomTracking".
now i am trying to define the following:-
- When a user click on a Department item inside the Department List.
- To show all the "Tracking" items from the Module sub-sites, which is related to the current department.
Now i have started with the following:-
- Inside the Department list's Display form (DispForm.aspx).
- I Edit the Page.
- I Add a content search web-part.
- Inside the content search web-part, I define to retrieve all the Tracking items that have the "CustomTracking" content type.
- So in this way I am able to retrieve all the Tracking items inside the department items display forms.
Now the only pending point i have, is that how i can define to only show the Tracking items which are:-
- Under a Module sub-site.
- and this Module sub-site have its URL equal to a Module item.
- and this Module item is under the current Department (current department mean the department item's display form).
Here is a drawing to describe my situation :-
so can anyone adivce if i can modify the display template of the content search web-part (where this web-part will be rendered inside the Department items Display Form), to only show the tracking items which are under a module sub-site and this module sub-site have its url equal to a module item ID which is under the current department item??