I'm working in a multi-site, multi-lingual sitecore project, and from time to time, someone adds lots of content on certain sub-site, fight hours with the publishing and being unable to see the updated content, and eventually realise after a couple of hours that all the input was in the wrong language for the sub-site.
So i'm wondering if there is a way in sitecore to support the following:
a folder (for a sub-site) that supports that after clicking an existing item below it, the language automatically changes to the default language for the site folder
since the language is automatically changed, new items created below that folder will be created in the default sub-site language, unless the user explicitly changes it to something else
If the above is impossible or not supported, an excellent workaround would be to be able to change the language of an item language version (say, i created an english version for a page on a spanish site with all the content in spanish, so i want to tell sitecore that i want to make this version actually the spanish version, without going into copying fields manually in the translate ui
It sounds like you might want to consider a few things:
The Language Fallback Provider - this allows you to have have content fallback from one language to another if it doesn't exist.
A custom extension (maybe an event handler for item:creating or item:created) to Sitecore to switch the context language based on where an editor is creating an item.
Just ideas right now...
An alternative approach would be to work with language read and language write security settings for your content contributors.
If your contributor for your Spanish site should only be adding items in Spanish then configure their access settings so that they aren't allowed to create content in other languages.
If you have a lot of content that has been entered in the wrong language then you can use the Globalization - Export language tool (from the Start menu) to export it to an XML file, manually replace the language tags (this is as simple as a search and replace on "en>" -> "es-ES>" for example) and then reimport it in the new language using the Globalization - Import language tool. Warning though: this WILL overwrite any existing versions.
Related
I have already customize the Page Editor Language Selector by overriding the webedit command, but I can't figure out how to customize the Content Editor Language Selector:
I am trying to replicate the functionality I added for the Page Editor Language Selector, which sorts the languages by region and then language name, and also adjusts the name to not display the ": language (region)" part.
I have already tried overriding the Sitecore.Shell.Applications.Globalization.SelectLanguage.SelectLanguagePage on the SelectLanguage.xaml.xml shell file, but that is for the More Langauges dialog and not for the initial view of the languages. I have also tried overriding the ribbon:languages command, but that is for the click event on each language for actually selecting it.
Any suggestions where else I should look for this functionality?
That menu is generated by \sitecore\shell\Applications\Content Manager\Galleries\Languages\Gallery Languages.xml and the associated CodeBeside in Sitecore.Shell.Applications.ContentManager.Galleries.Languages.GalleryLanguagesForm, Sitecore.Client
The rendering of each option is control by \sitecore\shell\Applications\Content Manager\Galleries\Languages\Gallery Languages.Option.xml although the values are set from the CodeBeside.
BTW, I just used the Chrome Dev Tools to figure out what was going on. From the Network Panel there is an XHTTP call to default.aspx?xmlcontrol=Gallery.Languages. Useful debugging steps.
We are attempting to implement Alex Shyba's Partial Language Fallback module.
I believe we have everything configured correctly based on the video. We've set the fallback language for ES to EN in Sitecore. We've verified there is a ES version of the both the template and the item.
We've enabled fallback on all the fields of the Home template.
After creating the Spanish version in Sitecore, I switch to version and it appears to be properly falling back to EN. Here is how both the Master db and Web db appear in the client:
This is screen shot is the ES version on WEB db. You can see there is content in the image and link fields.
However, when I hit the site, the content returns null and fails to display.
The module is a bit of a pain because of the lack of documentation (that I can find) and good examples on the web.
Could someone provide a link to a good working example or share how they've configured multi-site, multi-language sitecore?
I think you are misinterpreting how the module works. According to the documentation in the link you provided, the module detects the absense of a version in the current context language. If no version is detected, it falls back to the next available language version.
When an item is retrieved from a Sitecore database, the provider
checks whether the item has versions in the requested language. If
yes, then the item is returned to the caller. If there are not
versions in the requested language in the database, then the provider
performs fallback operation:
[Latest available item version in the fallback language is retrieved from the database]
You stated that you've set the fallback for ES to be EN, and that you have verified that an ES version of the item exists. From the modules perspective, everything is hunky dory... there is indeed a Spanish version, and so it will use it and not attempt to fallback.
That said, this doesn't explain why your field would be null while debugging. I suspect you simply need to re-publish the site in both languages.
I understand very well how Alex's Partial Language Fallback tool works. I have recently posted a 10 blog series on the topic in sitecore's technical blog area. If you'd like to see the details about how to configure it and what all the configurations mean, please see this post:
http://www.sitecore.net/Community/Technical-Blogs/Elizabeth-Spranzani/Posts/2014/03/Fallback-Series-Post-2.aspx
You are indeed correct, it is based on field fallback, not on the language version. You need to make sure you have the following:
fallback enabled in the site node of BOTH the site you are using on the front end and the shell site.
Both the web and master database referenced in the standardValues SupportedDatabases setting
Enforce version presence setting in side node set to 'false' or set to 'true' and have the version created in your language
The language you want to have fallback set to fallback to the main language in the system/languages section
The field in the 'english' version of the template is has the 'enable fallback' checkbox checked.
Publish the item in both language versions
You DON'T need to have different language versions of the templates, unless you have the Fallback.VaryFallbackSettingsPerLanguage in the config set to true. And I wouldn't recommend doing that, unless you want the field to fallback in some languages but not others. I haven't run into a scenario where that is necessary. But if you do decide to do this, you will need to make sure the checkbox is checked for every field in each language version.
I have a full working demo of the partial language fallback module here:
https://github.com/Verndale-Corp/Sitecore-Fallback-FullDemo
Make sure to uncheck the Standard fields checkbox when in content editor, to see the 'fallback value' text show to indicate whether a field is falling back. Otherwise, it will just show 'standard values'.
Liz
I want to create some kind of a blog, and therefor I thought it is clever to create an HTML-Template for each Content Element on a page.
How do I configure the typoscript to "load" an additional HTML-Template for each content element and put data like headline, author, pubDate... into the marks of that html-Template?
Install Extension Builder extension it will allow you create sample blog extension in several minutes of clicking....
Note: for TYPO3 ver. 4.7.x use Extension Builder with version lower than 2.5.0, and do TYPO3 ver. 60 just take the newest one.
I would recommend using the extension "news" (see http://typo3.org/extensions/repository/view/news). It seems that you're new to TYPO3. Therefore I wouldn't start with programming an own blog extension. For the beginning the before mentioned news extension will pretty much suit your needs.
Creating your own fields and using your own templates is not that easy and doesn't make sense since there are ready build and reliable extensions.
In a Sitecore Treelist or Multilist, items available for selection and items that have been selected are displayed using their Display Name. However, the language version that the Display Name is pulled from is the current Client Language, not the currently selected language of the item being edited.
An example illustrates the problem a little better...
We are importing a large amount of content into Sitecore in en-GB. We are not creating en versions of this content. Authors are logging in with a default content language of en-GB. However, Sitecore Client Language is only available in base en. The actual name of these items is not very useful (it's an external system ID), so we want the authors to see the en-GB Display Name in Treelist, Multilist, etc. However since their Client Language is en, they do not.
I see two potential solutions:
Somehow modify or trick the controls into using the currently selected language of the content item when rendering list items. (Preferable)
Somehow duplicate the en Client Language so we can set the user's Client Language to en-GB.
Any ideas on how to execute either solution, or alternative approaches to solving the problem would be appreciated.
Does this get you started?
What if you implement the Language Fallback Item Provider and set en to be the fallback language for en-GB? That will then show the en display name in the case where it doesn't exist for en-GB.
Let's say I have a web site that is translated in to two languages - English and Spanish. I want to give the users a toggle switch at the top of the page that allows them to switch back and forth between the two languages. How would I do that? I don't want to set up different websites. I only want one website. I just want the user to be able to click on a button or link or something and go from English to Spanish. Now as they move around the site they are viewing the entire site in Spanish. Then if they click on the button or link again they would go back to English. Is there something I have to do in the code behind to tell Sitecore to "use" a different language?
You can switch the context language using "sc_lang" query string parameter. For example:
http://youwebsite.com?sc_lang=en
Typically in Sitecore you will want to represent the language using the built-in URL prefixes, e.g. http://www.example.com/en or http://www.example.com/es. We often use a cookie that we read in the httpRequestBegin pipeline to enhance the Sitecore LanguageResolver. Your language "toggle" could appropriately set that cookie.
See this article by John West for more detail and sample code.
https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/repost-overriding-sitecore-39-s-logic-to-determine-the-context-language
You can write your own LanguageResolver Pipeline to do this.
Or you can extend your URL by Using the sc_lang querystring Parameter eg.: sc_lang=en-EN or sc_lang=de-DE. If you have configured your linkmanager fine this should work.