Path:{\SiteCollection.URL}/EN/MediaCenter/lists/MediaGallery/
I need to make "EN" dynamic as I have 2 languages in my site: EN, AR
something like ~language that is used in CSS references.
How can I query in the current site whether it is EN or AR without writing 2 conditions for it?
Hello,
you can use the PATH:{Site.URL} in this case the site.URL will give you the current site the CSWP is placed in
for example if you are placing the CSWP in the home page for each arabic and english to list latest videos/images
you need to path the query as
PATH:{Site.URL}MediaCenter/lists/MediaGallery/*
Site.URL will be replaced by http://sitecollection/en in english and http://sitecollection/ar in arabic
but if you are placing the CSWP in the mediacenter subsite home page you need to pass the query as
PATH:{Site.URL}lists/MediaGallery/*
Thanks Amr for your reply.
Actually, I have tried this solution, but I have got a problem with it. The issue I have is that the 'MediaGallery' list is in the parent sub-site, so I need to go up one level to access it. something like ../ we do in the command prompt, that's why I thought of the first solution of "SiteCollection.URL"
any thoughts?