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:35am

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
February 1st, 2014 12:41am

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

you can use the languages managed property and don't use the PATH but in order to do that  you need to use a distinct content type in the mediagallery pages 

I assume you have media albums if you create the albums (extend Folder) then you can search using the content type instead using

ContentType:Album

Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2014 8:36am

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

Other recent topics Other recent topics