VersionFromLanguage module crashes on Sitecore 8.0 - sitecore

One of our clients has recently upgraded their sitecore from 7.0 to 8.0 and they used to work with VersionFromLanguage module to duplicate same content to multiple languages. But after upgrade, the content editor crashes with following error if the module gets activated (by enabling its config file):
Could not load type 'Sitecore.Shell.Applications.WebEdit.Commands.WebEditCommand' from assembly 'Sitecore.Client, Version=8.0.5245.0, Culture=neutral, PublicKeyToken=null'
I was thinking about better techniques such as language fallback in long term but is there any quick fix to this module? (It must be something about the way buttons get registered on SPEAK UI comparing to older shell API, I guess)

A quick fix is to switch to Sheer UI.
In Sitecore 8, the Experience editor by default uses SPEAK for the ribbon.
To use old Sheer UI (if is an option for you ) you need to modify Sitecore.ExperienceEditor.config
<pageextenders>
<!-- Uncomment the page extenders below and comment the "Sitecore.ExperienceEditor.Speak.Ribbon.PageExtender.RibbonPageExtender" to switch to old SheerUI-based Experience Editor ribbon. -->
<pageextender type="Sitecore.Layouts.PageExtenders.PreviewPageExtender, Sitecore.ExperienceEditor" />
<pageextender type="Sitecore.Layouts.PageExtenders.WebEditPageExtender, Sitecore.ExperienceEditor" />
<pageextender type="Sitecore.Layouts.PageExtenders.DebuggerPageExtender, Sitecore.ExperienceEditor" />
<pageextender type="Sitecore.Shell.Applications.Preview.SimulatedDevicePreview.PageExtenders.PreviewExtender, Sitecore.ExperienceEditor" />
<!-- Page extender for SPEAK-based Experience Editor ribbon. -->
<!--<pageextender type="Sitecore.ExperienceEditor.Speak.Ribbon.PageExtender.RibbonPageExtender, Sitecore.ExperienceEditor.Speak.Ribbon" />-->
</pageextenders>
On next links you will find information about how to customize ribbons in Sitecore 8 and what steps you need to follow to fix your issues into Sitecore 8.
http://www.programmingbynumbers.com/2015/01/31/creating-a-new-experience-editor-button-in-sitecore-8/
https://doc.sitecore.net/sitecore_experience_platform/the_editing_tools/customize_the_experience_editor_ribbon

Related

Sitecore multisite setup with language-culture in url

I want to setup a sitecore solution containing multiple sites. The sites hostnames need to have the suffix language-culture, so I want the urls to be like:
[HOST]/de-DE
[HOST]/sv-SE
[HOST]/fr-BE
[HOST]/nl-BE
I tried to configure the sites with virtualpaths like "de-DE", but that does not help. How should this be configured?
And if I want the belgium site (fr-BE and nl-BE) to be one site with multiple languages (translations), but reachable from given url structure, how should that be setup?
You may have better luck getting answers on https://sitecore.stackexchange.com/, however, I will answer here as I am unable to move your question.
It sounds to me like you need a mixture of both separate website nodes for each site, as well as translated versions within some of those sites (fr-BE and nl-BE).
As long as the site definitions are patched in before the website node, they should be picked up by Sitecore's site resolver based on the virtualFolder. Please note there is a special requirement when using virtualFolders in which the physicalFolder value must match. More info on that here.
<site name="fr-BE" ... virtualFolder="/fr-BE" physicalFolder="/fr-BE" rootPath="/sitecore/content" startItem="/Home Belgium" language="fr-BE" ... />
<site name="nl-BE" ... virtualFolder="/nl-BE" physicalFolder="/nl-BE" rootPath="/sitecore/content" startItem="/Home Belgium" language="nl-BE" ... />
<site name="de-DE" ... virtualFolder="/de-DE" physicalFolder="/de-DE" rootPath="/sitecore/content" startItem="/Home Germany" language="de-DE" ... />
<site name="website" ... virtualFolder="/" rootPath="/sitecore/content" startItem="/Home" ... />
Notice how the first two site definitions point to the same start item (/Home Belgium in my example). This allows you to still use Sitecore's language version translation on that site, while keeping the item tree structure separate from the German site.
Next, you will need to turn off the strip language processor that is responsible for identifying and removing the language prefix from each request. This is on by default and will prevent you from using virtual folders that match a language code.
<!-- Set to false to allow language code virtual folders -->
<setting name="Languages.AlwaysStripLanguage" value="false" />
Lastly, make sure you have the proper languages installed and that your content is published in the appropriate languages.

Google Glass XE 17.3 - Multiple Actions From One Voice Trigger Broken?

One of my pairs of Glass updated itself to XE 17.3 this morning, and now, any Voice Triggers I have defined that are used for more than one activity no longer work. On previous versions, (and I've tested my code on an XE 17.2 pair I have to make sure I didn't break anything today), if multiple activities were set to use the same Voice Trigger, the system would prompt you to select from a list upon hearing that voice trigger. This is expected behavior (in case two applications use the same trigger), and actually was quite useful for creating a sub-launcher for your application (which is what I was using it for...say main launch name -> get a list of activities to choose from within the app, all automatic and handled by the system).
Now, however, if my Voice Trigger is assigned to two or more activities within my manifest, it will show up in the list, but will never trigger when you say "OK Glass - [voice trigger]" (it does still work with taps, however). As I mentioned, I tested the exact same code on a pair running XE 17.2 and it worked fine. I also removed the trigger from all but one activity, and it works on 17.3 when you do that...so the problem is when you have more than one possible activity that handles a given voice trigger.
The way I have my manifest set up seems correct to me (and works on older versions of the firmware):
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
...
<!-- one of the activities. this is inside the application element, of course -->
<activity
android:name="com.someapp.MainActivity"
android:label="Option 1" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voiceinput_main" />
</activity>
<!-- another activity, again inside the application element, sharing the same trigger -->
<activity
android:name="com.someapp.AnotherActivity"
android:label="Option 2" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voiceinput_main" />
</activity>
And, this manifest works fine on XE 17.2. Anyone know of something that has changed in 17.3 that would break this, or see anything that looks wrong? I know that the <action android:name="android.intent.action.MAIN" /> line isn't necessary, but removing it doesn't fix the problem.
Thanks!
in my case, I change my voice trigger string "all in lower case" thing solved my problem, maybe you could give it a try, custom Voice trigger command XE17.31
This seems to only affect custom voice triggers. I'm seeing the same thing with an app I'm developing where I use "Debug ..." as a trigger to let me do a number of things to reset state or launch test actions.
If you change the trigger to an existing command listed here then it should start working again. If you're using the mechanism in the same way I am, you can probably just pick an obscure existing command to use for testing purposes (I'm using FIND_A_DOCTOR, which seems apropos for debugging purposes).
If you're simply using a custom command as part of normal flow, presumably it will either become an accepted command, or you'll have to switch to an existing command eventually, since the custom commands only work in debugging anyway.

Google glass Immersive app icon doesn't show

My app icon has disappeared, I've sourced it to the activity alias's I am using. I want them to display as sub menu voice commands so in the manifest I've added the VOICE_TRIGGER action. When I remove this the icon re-appears.
Any ideas for a work around?
Here'a an example of an alias:
<activity-alias
android:label="#string/do_thing"
android:name="#string/do_thing"
android:theme="#android:style/Theme.DeviceDefault"
android:immersive="true"
android:targetActivity="com.x.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger" />
</activity-alias>
Maybe the text of the menu item is too long? I have had this before and with a long text, my icon also disappeared. When I shortened the menu text, the icon appeared again.
This is because you need to use the voice command in here:
https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/app/VoiceTriggers.Command
if you use the your own voice command, the icon won't show on XE18.3
I believe this is a known issue with 18.3 (https://code.google.com/p/google-glass-api/issues/detail?id=559) and was indicated fixed around July 8th.
So hopefully you aren't seeing this anymore in any release past 18.3.

How to insert custom Javascripts in Sitecore backend

Pretty simple, I need to insert a script in Sitecores (v. 6.4) backend - how do I do it?
It doesn't matter if the script is placed inside <head> or <body>, nor does it matter if I can only specify the src of a <script> tag or if I can insert an actual Javascript snippet (the latter is preferable though).
The script needs to be inserted in the HTML when a Content Editor window is opened.
It is not an installation of my own, nor do I develop anything for Sitecore (I do have admin access, however), so something along the lines of installing a plugin would be the best solution I reckon.
I've previously inserted the script in Sitecore 5.4, but not in a pretty way (editing XML files) and if a better solution could be found here too, that'd be pretty great.
Update using Jens Mikkelsens answer in Sitecore Xpress 6:
I tried placing the following in web.config:
<clientscripts>
<everypage>
<script src="/test.js" language="javascript" />
</everypage>
<htmleditor>
<script src="/test.js" language="javascript" />
</htmleditor>
</clientscripts>
Being a little bit overzealous (and wanting to make sure the test.js file can be found) I put a js.test in the following locations:
inetpub\wwwroot\SitecoreWebsite\WebSite\sitecore\shell\Applications\Content Manager\
inetpub\wwwroot\SitecoreWebsite\WebSite\sitecore\shell\Applications\
inetpub\wwwroot\SitecoreWebsite\WebSite\sitecore\shell\
inetpub\wwwroot\SitecoreWebsite\WebSite\sitecore\
inetpub\wwwroot\SitecoreWebsite\WebSite\
Content of the test.js:
alert("Test [PATH TOKEN]");
Where the path token is just the parent folder name, so I know which test.js was loaded, e.g. inetpub\wwwroot\SitecoreWebsite\WebSite\sitecore\shell\Applications\Content Manager\test.js holds:
alert("Test Content Manager");
When I try to log in using the default Xpress admin user one of three things happens (in all three cases the frontend loads without errors, but no script present. I have NOT been able to determine when the errors happen, the only thing I can say for sure is that no errors occur when the test.js has not been included in web.config):
Case 1:
The content editor loads as expected, but no script is loaded. This happens most of the time when the clientscript have been included.
Case 2 - Server Error:
Server Error in '/' Application.
Exception Details: System.ArgumentException: Empty strings are not allowed.
Parameter name: value
Stack Trace:
[ArgumentException: Empty strings are not allowed.
Parameter name: value]
Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName) +241
Sitecore.Web.UI.HtmlControls.PageScriptManager.GetEveryPageScripts() +410
Sitecore.Web.UI.HtmlControls.PageScriptManager.GetScripts() +702
Sitecore.Web.UI.HtmlControls.Page.OnInit(EventArgs e) +62
System.Web.UI.Control.InitRecursive(Control namingContainer) +143
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1477
Case 3 - Sitecore error:
A required license is missing
Most likely causes:
The resource you are trying to access requires the following license: Runtime.
I'm not sure whether or not Xpress simply doesn't support clientscripts, but even if it doesn't it is weird that some times the content editor loads.
Update after testing in Sitecore 5.4 full version:
It does indeed work to put a script tag inside the <clientscripts> section in web.config as Jens Mikkelsen answered. It is, however, neccessary to put it inside the subsection <everypage> to get it to appear on every single page in the backend, whereas <htmleditor> only works for the Telerik RadEditor popup window in Sitecore 5.4.
Update after testing in Sitecore 6 full version:
The same method as described for Sitecore 5.4 works for Sitecore 6 with the addition of little thing: <script> embedded in <clienscripts> now require a key attribute:
<clientscripts>
<everypage>
<script src="/test.js" language="javascript" key="test script" />
</everypage>
</clientscripts>
I don't think you will be able to add the script with out modifying a file. However you can take a look at the <clientscripts> section in the web.config. There you can add scripts to be loaded. However I don't know if it will only load in the content editor.
I have experimented with this before, and I ended up using the above setting, but as I remember it also loaded on the Page Editor and the Desktop.
Perhaps you can use this example code to add controls to the <head> on the front-end but instead alter it to use the <renderContentEditor> pipeline to somehow inject a new <script> tag into the editor.
here is a good example of it Injecting javascript and css to Sitecore Content Editor Page

Sitecore set/change default language from 'en'

Can anyone recommend the best way to change the default language in Sitecore 6.1. On a fresh install, the typical language for all items is 'en' English, witha nice little USA flag and all.
However, we are setting up a system which is targeting en-AU and en-NZ. When I rename the main 'en' language item in any database, every other item is left without a version in the "correct" language. I recall in the past that renaming this item causes an update across the whole system, but that didn't seem to be the case when I tried it today.
Is there an easy "Sitecore" way to convert all default items to the primary language en-AU? I've considered running a sql update script over the database, but am hoping there is a neater way of doing it.
I don't think that changing anything about the en-language is a good idea. A lot of internal Sitecore objects are based on that language and you could risk loosing labels and help texts in the Sitecore UI.
We usually create all templates, renderings and layouts in the en-language and then create the content items for each language.
Instead you should set the language property in web.config for your site.
Here is an example that we are using from one of our multi-language solutions:
<site name="website_no" hostName="www.site.no|site.no" language="no" />
<site name="website_en" hostName="www.site.com|site.com" language="en" />
<site name="website" language="sv" />
The last line catches all requests not caught by the two first ones.
Couldn't get a site to use Danish as default language for backend UI based on value language="da" in <site...> tag. Changed it to da-DK, which made it work. Don't know if this is expected behaviour, but one might use the fully qualified ISO code to make sure, things are good.