Sitecore 8:Custom Dropdown List in RTE - sitecore

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

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)

Experience Editor custom functionality

In some of our pages, we have a component that is a list of links. In Sitecore, this is stored in the following manner -
- Component data source
- list item 1
- list item 2
- list item 3
Right now the Sitecore users can only add links to the list by going into the Content Editor and manually adding a list item. This is not very convenient for users as they have to constantly switch between Content and Experience Editor.
I would like to provide a functionality in the Experience Editor itself which can allow users to add these link items using a layover type functionality.
I did a quick search and wasn't able to find anything concrete. Is there a way to update achieve this functionality?
You should create a custom WebEdit button which will allow to add children to your datasource.
You can read more about it here Sitecore Page Editor: Creating a WebEdit button

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 Conditional Showing of Fields

So I am rather new to sitecore, and it's a topic that wasn't covered during my training. My questions is just to help point me to the correct term, or documentation on a method to do the following.
I have a definition item, with a ton of field groups, what I want to do is something like:
if Value of Field X is "yes" then collapse/hide Field X or Field Group X.
Does that make sense? Is it a validation rule? or some other kind of rules, is it a workflow I need to attach? Do you place it on just the field I want to hide, or the field that triggers the action?
I appreciate any guidance.
There is nothing out-of-the-box in Sitecore to achieve what you want but there is no reason you cannot create a composite custom field type to do this. The following articles will help you achieve this:
Creating a custom Sitecore Field
Getting to Know Sitecore: Custom Fields, Part 1
Create a new control, inheriting either from Droplist (if the comparison of the value is to be text based) or Droplink (for comparison of ID). You could add a parameter in the Source field of the control to specify what the values that trigger the hide should be.
The underlying control in the Content Editor is just a standard HTML select element. Add onchange events to the control and add your Javascript handler to hide the other controls. Since I could not find a way of adding additional custom css classes to the Sitecore controls, it would be best/easiest to hide all other controls in the same collapsible group after you control. This would mean you would need to group your controls better (or logically at least).
The Javascript will be something like this (the Content Editor uses the Prototype JS framework):
if ($(this).getValue() == 'no') {
// find the parent container of this control and then hide all the next siblings in the same group
$(this).up('.scEditorFieldMarker').nextSiblings('.scEditorFieldMarker').invoke('hide');
}
You can test this by running the above in the console, change out the keyword this with the id of your field, e.g. $('FIELD2292054').
What I am not sure about is how to trigger the hide on initial load, i.e. when someone returns to an existing item, it may be possible by adding to one of the pipelines, but would be better using a JS solution if possible. I'll have a think about this and get a proper code sample up over the next few days.
EDIT: You can add an event handler to sc:contenteditorupdated to handle the content editor being rel-oaded.
document.observe("sc:contenteditorupdated", myFunction);
I wrote up a blog post and put the code on GitHub if you are interested.
Not sure if you have come across Andy Uzick's this blog post.
He wisely talks about hiding fields in the Content Editor and has also created a Sitecore Module called Hide Field Template Extension which is hosted on the Sitecore Marketplace with the full source code to extend.
After reading through and trying the extension, I do feel that it will not completely resolve your issue (how you have described it in the question).
But it will give you:
A mid-term solution to hide a few unnecessary field that some content editors would not like to view.
Fields that are only required by administrators for admin purpose - to de-clutter these fields could be hidden.
Just one thing to bear in mind that it mentions in the requirements Sitecore 6.5 & 6.6. I have not tested it in Sitecore 7. If you are using Sitecore 7, which I think you are, one could modify the source code and make it work for Sitecore 7.
Have a look and share your findings.
Happy Sitecoring!

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