Remove Item Version - sitecore

Reference to Sitecore's documentations and this related question, the 'Versions' tab in the Ribbon tag supposed to have the option 'Remove' to remove specific language version of the selected item, I have this option for most of the items, but in below scenario, after adding new language version to item, I can't find 'Remove' option:
Create Template 'Sample'-> Create Section 'Data' -> Add Field inside (which is item at the end) -> Add new language version of this field -> Here 'Remove' option will not be exist in 'Versions' tab.
Note: I've just added this version by mistake and just want to Undo it (remove this version).

You cannot remove version of templates, template sections and template fields using Content Editor.
You can use DB Browser application instead. You can open it using /sitecore/admin/dbbrowser.aspx url.
You will see Delete version button there.

I have implemented a tool which is already available from Sitecore Marketplace. The tool allows you to remove the different version on items. For example, if you select an item, it will show all the version the item contains and also possible language version.
Here is the link to the module on marketplace: Sitecore Version Remover

Check if you have the correct rights. It should show remove button like follows:

Related

Sitecore C# - move up / down an item in the same folder

The title says everything about my question
On sitecore 6.6 I have to order the items in a folder and I've been google it for few days with no success.
Can anybody help ? I've tried setting up __Sortorder field but I get an error saying that the property is readonly.
From what you wrote ("but I get an error saying that the property is readonly"), you haven't started editing the item before changing the Sort Order field value.
Simplest code is:
item.Editing.BeginEdit();
item[Sitecore.FieldIDs.Sortorder] = "25"; // or any other new value
item.Editing.EndEdit();
Editing.BeginEdit() and Editing.EndEdit() are required before and after every item change operation.
In older Sitecore versions devs used to use using (new Sitecore.Data.Items.EditContext(item)) instead, but from what I remember it's not recommended anymore.
Here is a sample article about Sitecore item editing: How to edit an Item in Code Behind
The __Sortorder template field has a "Read only" checkbox that you can use to allow the field to be written to.
You can use the Sorting buttons in the Home menu:
Select the item to move/sort
Open the Home menu
Use the Up/Down/First/Last buttons in the Sorting section
Or the keyboard shortcuts:
Up: (Ctrl+Shift+Alt+Up)
Down: (Ctrl+Shift+Alt+Down)

Sitecore 8:Custom Dropdown List in RTE

I am trying to implement a custom drop list in RTE in Sitecore 8.The drop list on selection should just insert the associated value of the selected item from the drop list to RTE.
I followed the blog post at https://jammykam.wordpress.com/2014/06/17/add-custom-drop-down-list-to-rich-text-editor-in-sitecore/ and Custom RTE Dropdown in Sitecore 7.0 to implement this.However it does not work in sitecore 8.
Can you please let me know on how to achieve the same.
Thanks In Advance,
I just tested and it's still working the same in Sitecore 8 as it previously did in Sitecore 7.x versions, just as I previously answered and blogged.
Since the change is not showing up then there are some things to check:
Make sure you are editing the correct Rich Text Profile, there are several defined by default. Check your config for HtmlEditor.DefaultProfile setting for the default profile in use
Make sure your template is has not set a different profile to use. Check the source value of the Rich Text field on the template to make sure it does not override the default.
I can confirm this works in Sitecore 8 as I implemented the same thing following #jammykam's blog.
Double check your custom drop down is of template /sitecore/templates/System/Html Editor Profiles/Html Editor Custom Drop Down or /sitecore/templates/System/Html Editor Profiles/Html Editor Custom Drop Down Button
and your list items are of template /sitecore/templates/System/Html Editor Profiles/Html Editor List Item

Sitecore add new Version for large number of items

I have a very large number of items that have versions on only 'en' language.
I have to create 'de' versions for all these items. (switching the language to 'de' in content editor and clicking 'add new version' and thats all, nothing to translate). The items are children of a common parent and it applies to all the children of that parent root item.
what would be the most practical way to do this task?
There is a challenge in this issue. I have access to only sitecore content editor with admin user. I cant program a script and run it on the system.
You would do something like this:
var master = Sitecore.Configuration.Factory.GetDatabase("master");
// Get the root folder of the items you want to create versions for.
var root = master.GetItem("path_or_GUID_to_root_item");
// Switch to the language you want to create versions for.
using (new LanguageSwitcher("de"))
{
// Loop through all descendants.
foreach (Item descendant root.Axes.GetDescendants())
{
// Create new version using the current context language.
var version = descendant.Versions.AddVersion();
// Lines below are optional if you want to add field values to the version.
version.Editing.BeginEdit();
version.Fields["field_name_or_GUID"] = "value";
version.Editing.EndEdit();
}
}
Bare in mind that Axes.GetDescendants() is not very performance-friendly if you have many items.
So if you're serious about it, use the ContentSearch API to retrieve the items.
But at least you get the idea on how to add a new version for a specific language.
There is a module called ItemVersioner in the Sitecore Marketplace. WIth this module you can create item versions of all available languages with one click. This has two drawbacks:
You have to click on every item and click another time to add the versions. If your tasks is a one time task, it's maybe a solution anyway.
It creates versions for all languages configured under /sitecore/system/Languages. If you have other versions than "en" and "de", you may have to delete them temporary if you don't want to create these versions too.
If this is not a solution, I think you must create some custom code. I think the code from Ruud van Falier is ok to start from. You need to create this code on your local machine and if this works for you, you can create a Sitecore package with this code (have a look on the SDN here for informations about how to create a package). You can then install this package on your system and start the code (you may also create a new ribbon which executes the code to create versions, check this thread for a starting point).
If you really have no content to translate and you only want to display the en version of an item for de when it does not exist then you should consider using the Language Fallback Module, this is exactly what the module is designed to do.
If later you need to add de versions of items then you can do that on a case by case basis as the content gets added.
Please use below URL to solve it -
http://www.cognifide.com/blogs/sitecore/quickly-create-new-language-versions-on-your-sitecore-cms/
http://blog.boro2g.co.uk/create-a-version-of-an-item-in-all-languages-in-the-sitecore-client/

Sitecore content versioning issue

This is occuring in Sitecore version 6.4.1 (rev. 110720)
Recently, I've had an issue with several users who have unintentionally created a new version of an item - which contains "empty" fields. This is confusing to users because they don't realize that they are seeing a different version of the item, and they think that their content is randomly disappearing.
I don't know how to reproduce this, much less figure out how they are creating these "phantom" item versions.
I am reasonably certain that Sitecore users are not explicitly clicking "add" a new version in the top menu. From what I've been told, all they are doing is "locking" the item for editing, and this seems to create the new version of the item. At this point, it appears that the new version is the "default" that they are seeing, and they are complaining that the content has been "lost."
Is this Sitecore's default behavior - to create a new version of the item when the item is "locked" for editing? Or is this a known issue in this version of Sitecore?
If an item belongs to a workflow then when you hit the "Edit" button it will create a new version automatically for you.
Also, something to look into, in previous versions of Sitecore there were numerous issues where many actions in the content editor created versions of items unexpectedly (sorting for instance). See http://seankearney.com/post/Sitecore-item-and-version-design-flaw.aspx for more information on that.

Find all the item that is using a common Sublayout in sitecore 6.2.0

Is it possible to obtain a list of all the items in sitecore that is using common sublayout or XSLT's in presentation tab for rendering i.e. suppose there is sublayout called layout1.ascx that is being used by 5 items.is it possible to obtain the list of all these 5 items by search method.
Thanks in advance.
Regards,
Divya
You probably need to do this in two steps (or one if it's only 1 template).
You need to use the Link database.
The simplest way of seeing these "links" is to go to the Sublayout or Rendering and go to the "Navigation" menu and then click on "Links". This should show you all the items that point to this current item and all the items that the current items points to (ie. both ways).
This will probably give you a list of templates and/or items (if the sublayout is set directly on an item).
Then go to a template and see how do the same to see which items are have a refernce to the template.
This should show you which items are using which sublayouts.
Of course this requires the Link database is up to do (should be done automatically, but you can force this with Start > Control Panel > Databases > Rebuild Link Database) and that the Sublayouts etc are bound in Sitecore..
I hope this helps.
The Link database suggestion is great, but if your sublayout is used by hundreds of items, it may take a little while to load.
Another alternative is this fast query:
fast://*[#__Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%' or #__Final Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%']
This can be run in the developer center, under Tools > XPath Builder (or for Sitecore 8.x the XPath Builder can be found at /sitecore/shell/default.aspx?xmlcontrol=IDE.XPath.Builder).
Sitecore 9.x no longer supports the XPath Builder, but you can still run this if you install the Sitecore PowerShell Extensions.
The following command can be run:
Get-Item -Path "master:" -Query "fast://*[#__Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%' or #__Final Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%']"
Change the guid above as needed.