Hello all
I have a Drupal 10 multi-language site (Italian and English) in which I've enabled the translation of the Article content type. The site was set to generate automatic aliases for Article(s).
If I create an article with the title "test lang not specified" for which I set the language "Not specified", the automatic alias /article/test-lang-not -specified is generated according to the pattern /article/[node:title]. However, the alias does not work. The node is not accessible, even by using the canonical path /node/122.
Can somebody explain why this behavior. How can I make available this entity through an URL? Is it possible to have aliases for entities with language not specified?
Links to documentation about how Drupal handles a request in a multi-language site would be very welcome.
Thank you
Cristian
Comments
if you create an article and
if you create an article and set the language to "Not specified," the URL alias might not work because Drupal doesn’t know which language to use for the link. Make sure Drupal is set to handle "Not specified" languages correctly in its settings. Also make sure it is not blocking URL aliases for content without a specific language.
if not work after this , then you may need to add custom code to make it work, after making changes make sure you clear cache so Drupal updates everything.
you can also check their documentation for proper detailed guide on Drupal URL aliases and multi-language.
Thank you for your reply.
Thank you for your reply. What does it mean to "Make sure Drupal is set to handle "Not specified" languages correctly"? There are pages on the net talking (including ai software) about a fallback language. I am not able to find such an option at any of the following locations:
ahh yes those settings,
ahh yes those settings, actually when content is marked as "Not specified," Drupal might not know which language to use, which causes problems with the URL and makes the page hard to access. try changing settings ; Go to /admin/config/regional/language/detection. Here, you can control how Drupal picks the language for content. If the language is "Not specified," set the site’s default language (like English or Italian) as the fallback.
Go to /admin/config/regional/content-language. Make sure Drupal allows articles to have a "Not specified" language. You might want to check that important fields like the title and URL are set correctly for this.
Go to /admin/config/search/path/patterns. Check that Drupal isn't blocking URL aliases for "Not specified" content. Make sure it generates URLs properly, even for content without a specific language.