I am working on a content search web-part inside my SharePoint Enterprise server 2013.
Now i have the following general overview of my current sites and lists which i am trying to query inside my web part:-
- Inside the Root site i have a list named
- Inside another sub-site I have a list named
Modulewhich have a lookup field (
DeptID) referencing the
- Now for each
Moduleitem (inside the Module list) we have a sub-site representing this module item. the sub-site url will contain the module item ID, as follow;
http://servername/Modules/1(representing module item id 1),
http://servername/Modules/2(representing module item id 2), etc..
- Inside each
Modulesub-site we have a Tracking list.
Now i have added a Content Search WebPart inside my
Dept list's display form; to show all the Tracking items which are related to the current Dept Item (the dept item which is being rendered inside the display form).
So inside the content search web-part i am trying to do the following:-
- Now by default when users click on a certain
Deptitem, they will be redirected to the display form. and the department ID will be inside the URL such as
- Using REST API i can query all the
Modulesitems (inside the Module List) which have their DeptID (lookup column) = the current DeptID (for example 16 ).
- So in this way i will have a list of all the module items' IDs which are related to the current Dept.
- Then i can inside my content search web part's display template (which will mainly show all the tracking items from all the module sub-sites) to specify to only show the Tracking items which are inside a sub-site and the sub-site's url = one of the related module IDs...
Now i am not sure how i can achieve these four steps inside my display templates?