KQL - language variation

I am using this KQL line in CSWP, SP2013

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?

January 30th, 2014 3:33am

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/*

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2014 4:42pm

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?

February 3rd, 2014 4:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics