Customize Sitecore Content Editor Language Selector - sitecore

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.

Related

Sitecore 8 implement tooltip on RTE authored content

We have a requirement to implement tooltips for words that are authored in Sitecore RTE.
The idea behind is that user should be able to hover over the word and see it's description/meaning.
Is this possible to achieve in sitecore? Did a quick search on marketplace but could not find any modules.
Below are some options to consider for achieving what you described.
Inject Tooltip HTML in a renderField pipeline
In this option, you would extend the renderField pipeline. First, you will need to ensure that you are dealing with a rich-text field, and if so, locate terms and replace them with the necessary markup that is required for the tooltip. This could be as simple as wrapping the word in an <abbr> or perhaps a <span> element with a CSS class. The list of terms and tooltip content could be sourced from items in Sitecore or a custom Sitecore Dictionary. Caching the terms would be essential as this pipeline processor is invoked frequently every time a field is rendereded.
Progressive enhancement with JavaScript
This approach is almost entirely based on the client-side. Terms could be located and replaced fairly easily with the help of JQuery. If the list of terms is of a reasonable size, they could be bootstrapped into a JavaScript variable. Once terms are located and enhanced, a separate, asynchronous call to a REST endpoint could be made when hovering or clicking the term. The API would accept a term and respond with the term's definition.
HTML Snippet in RTE Editor
Sitecore RTE editor can be extended with additional buttons. One of these options allows you to insert predefined snippets of HTML. The RTE editor also has a setting to specify a CSS file to style the content within the field (<setting name="WebStylesheet" value="/css/yourstylesheet.css" />). Styling would be necessary in order to target the description markup and make it visible to be edited, whereas, on the public site, the description markup would normally be hidden by default until the term is clicked on or hovered over.
Dynamic Link Replacement
http://www.layerworks.com/blog/sitecore-token-replacement

sitecore editframe button support multilanguage

I have been playing around with Editframe buttons in a Sitecore 8 for a multilingual project and I have the feeling that Edit Frame buttons do not work properly on sitecore multilingual sites.
Were you able to get it working edit frame buttons with a multilingual implementation?
Is it working out of the box or do you need any special configuration?
My experience is that when I am on a localized page and I click on an EditFrame button, it will open the default language Item instead of the localised item. I am of the impression that this is what happen when you click on Edit the Related Item in the Experience Editor.
I encountered your scenario very recently.
Were you able to get it working edit frame buttons with a multilingual implementation?
Yes, all the Fields I set up within the Edit Frame Buttons in the Core worked correctly with my Multilingual Site
Is it working out of the box or do you need any special configuration?
You need to add your Field Names into the Edit Frame Button Items in the Core database, found at the out-of-the-box path; /sitecore/content/Applications/WebEdit/Edit Frame Buttons/Default/Edit. Make sure your sc:Edit component references this path in the Buttons property
You may use different Display Names of the Fields for each of your languages for ease of use in the Content Editor / Experience Editor but as long as they are display Names it should be fine. If they are not and it doesn't work I recommend putting the Field Name for each language in the Edit Frame Item.
When I click on an EditFrame button, will it open the default language Item instead than the localised item, I am of the impression that this is what happen when you click on Edit The Related item as well
No, in both instances the Item will be loaded in the correct Language as well as when you create a new Datasource Item to be referenced by your Component.
The biggest issue that is present is when Edit the Relating Item and make changes to Rich Text Editor field or TreeEx field is that when you save it, it saves it to the default enlanguage, even creating a Language Version for it if it does not exist.
I have raised this issue with Sitecore Support and they are currently investigating. When they have a fix I'll update you with their solution.
EDIT
The Support Patch to resolve the issue Edit the Relating Item saving changes to the wrong language version of the Item can be found here - https://kb.sitecore.net/articles/814090

Sitecore how to hide/disable HTML tab from your Rich Text Editor

Could someone suggest how to hide/disable HTML tab from your Rich Text Editor on sitecore?
I had a look at this, but requires a change on Sitecore core rich text XML.
Problem with this solution is we need to modify the XML for each instance and what about upgrades?
Thanks.
In the Core database (you can switch using the icon in the bottom right next to the clock) you can go to /sitecore/system/Settings/Html Editor Profiles/*profile you want*/buttons/HTML view and deny read-access on that for your users. Alternatively, at least in Sitecore 6.5, there's a profile without the HTML view. It's called Rich Text IDE. You can set the datasource field of a Rich Text field to that one, and not have the HTML view.
That's only removing the HTML option on the bottom left though, I'm not sure how to remove the Edit HTML option you have before you've opened the RTE itself (where you have Show Editor/ Suggest Fix / Edit Html). Looking at This question it might be you'll have to change the XML anyway.
The way we've got upgrades and different instances handled is by having the changed file in source control, and making sure we include it when building a deployment package.
Adding onto Trayek's great answer - you can remove access to the "Edit HTML" as outlined by Alex Shyba below:
Go to the core database, locate the field definition item:
/sitecore/system/Field types/Simple Types/Rich Text/Menu/Edit Html
On the Security Tab, click “Assign” and select the role you don’t want this option to be available to. Deny inheritance of this item or specify other security settings that make sense for your needs.
I added "Everyone" and then selected the "X" by Inheritance for Items, and the "Edit HTML" option was removed.
Taken from:
http://sitecoreblog.alexshyba.com/2009/10/quick-tip-remove-edit-html-option-for.html

default languages for items and folders in sitecore

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.

Update a view plugin from an action in text editor plugin

I have two eclipse plugins(custom text editor plugin and a view plugin as two different projects). There is an action in the text editor that builds index of 'functions' of all dependent source files. At the end of this action I would like to show index(list of 'functions') in a tableviewer of the view plugin. What would you say the best way to achieve this? The view does not have to listen to the editor. It should be updated only when an action from editor plugin fires.
I exported a package from the editor plugin and exported another package from the view plug because text editor plugin needs to reference view type to populate tableViewer in the view plugin, and the view plugin needs to reference editor type in tableviewer's contentProvider. But I am getting an build path error:
A cycle was detected in the build path of project
How can I resolve this? Or If this is a bad approach, do I have a better way?
Thanks.
tk.
First of all, circular references between plug-ins are not allowed. So when you need to share information bidirectional between plug-ins, you often have to refactor the problem, to have a listener pattern for one of the directions.
In this case, I would use the same structure for your view as used for the existing Outline view. So your view should sub-class the PageBookView which have a rather simple protocol for how a participating editor can provide data to the view.
Basically I would do the same as done for the Outline view, and let the editor itself provide the content of the view via adaption. The Outline view does this by tracking the current editor, and whenever a new editor is "seen", the Outline view attempts to adapt the IEditorPart to IContentOutlinePage. The editor is responsible for the SWT widgets and listeners, etc that will be needed in the view page for this particular editor... Have a close look at the JavaDoc for ContentOutline - this is a rather good description of the protocols involved.
If you have multiple "open" editors, then the new view will automatically show the relevant information for the active editor and not "just" the editor that was active the last time you executed your action.
With this scheme, your action will simply
Show (and activate) the new view. This can be done via IWorkbenchPage.showView(...).
Request the provide page to update its view...