Hello everybody,
- my drupal (up to date) site has i18n installed, multilanguage english/italian, marinelli custom theme installed (don't know if it could be useful).
- the site main language is english, the second language is italian, all nodes are translated in both languages.
- every node has its url alias.
- i have a couple of other modules installed, not related to the problem though: views, webforms, custom breadcrumbs, image, google analytics.
when I search for something in the search box, browsing the site in english language, i got results pointing to the right url path (the alias) like en/products/product1 and so on for each result. that's good, this is the behavior i want.
but when I search browsing the italian version of the site, i got links to node/15, node/20 instead of the related URL alias like it/prodotti/prodotto1 and so on. I would like to see the url alias.
How can I fix this?
thank you.
Filippo
Comments
Administer -> Site configuration -> Languages
Go to Administer -> Site configuration -> Languages and then click on Configure tab from tabs.
you will see "Language negotiation" options. please select "Path prefix with language fallback" and save it.
You will get all of your path with language prefix. If you do not have prefix of language then add it from "admin/settings/language/edit" for particular language.
Good luck,
vijay
Thanks,
Vijay Thummar
Everything is already
Everything is already configured as you said:
- 'Path prefix with language fallback' selected
- language prefixes set to 'en' for english and 'it' for italian.
What I tried is to switch the default language from english to italian. doing this, search results for the italian language show correctly url aliases and english results don't (they show node/12 etc).
seems that search engine with url aliases works only if you search in the primary language site. what do you think?
btw: in my profile there is the url of my website, just to give it a try. search box is on the top right corner, you can search for the term 'chianti' that returns several pages.
ps: i set back english as default language.
SOLVED
The problem was in "Administer / Site configuration / Multilingual system"
if you want to use the search function in a multilingual site with url aliases, you have to select one of the following, accordingly with your website structure:
- "Current language and language neutral."
- "Mixed current language (if available) or default language (if not) and language neutral" (not sure about this one if you have translations out of sync).
- "Only current language."
personally: option one suits my needs.
The following options mess up the search results consistency with url aliases:
- "Only default language and language neutral."
- "All content. No language conditions apply."
Cheers.