The simpler media website CMS
Hi everyone!
I am developing a custom Zenphoto theme & using zp_show_search() to provide a universal search box. Everything works fine in single language mode but when multilingual mode is enabled (using the multilingual plugin), search results often show duplicate entries one for each language version of an image /lbum.
I have confirmed that the actual media files are not duplicated & the database only has one entry per item. It seems like the search is returning results across all language contexts simultaneously; rather than filtering by the current language. This causes confusion for users who see multiple identical results with slight label differences.
Checked https://www.zenphoto.org/news/functions-documentation/ guide for reference.
Is there a recommended way to modify the theme / hook into the search system to limit Golang Course results to the currently selected language only? I'm open to filtering results manually / overriding the query logic if needed.
Would appreciate any pointers or plugin tips that could help streamline this for multilingual setups!
Thank you !!
Comments
Removed a link in your post that has nothing to do here. If you post wasn't a clever SEO spam attempt:
I have no idea what zp_show_search() is doing. That is not an official function. There is also no multilingual plugin. The multilingual mode is enabled via the options. Are you referring to the dynamic locale plugin for selecting a language on the theme?
There is no way that you get several results per language because as you mentioned there is always only one item. That items stores all the multilingual content as an serialized array.. So something is not correctly setup on your theme. Use the standard theme functions. Please see the theming tutorial https://www.zenphoto.org/news/theming-tutorial/ and the reference to the demo theme repository on Github to learn how to create a search results page.