Sitecore disable field dynamically - sitecore

Trying to achieve very simple thing, but could not find how to. If duplicate, my apologies !
So I am trying to help a bit for a content editor, whenever flag Redirect To previous page is set to true, I would like to disable (a.k.a grey-out) Link to Main HomePage which is dropdown selection
Note: Sitecore version used: 9.1

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 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

How to better manage versions in Sitecore Page Editor

The way that Page Editor handles versions has been causing issues for in one of our Sitecore solutions for a client. I've posted about them here:
Sitecore instance showing incorrect workflow state in Page Editor
Expected usage of Page Editor's Experience date
I didn't get much response on those and so far I've surmised that this is just how Sitecore works. This is less than ideal for our instance, as when publishing restrictions are set, authors don't know which version they're editing which is causing various issues for them.
I'd like to implement a solution(s) to improve the experience provide the following functionality:
Something in the Experience tab that shows the number of the version being viewed.
A button on the Experience tab that resets the Date to the default (this is not simply setting the date to the current date/time, but resetting it to act as it did before a date was manually set).
A custom button in Content Editor which allows an author to open a specific version in Page Editor...set the date automatically when it opens, I guess.
An any one give me some clues on how much of this is possible and where to start?
Thanks.
For the first bullet "Something in the Experience tab that shows the number of the version being viewed", you can add version item in Core database.
Move to "Core" DB in Desktop Mode
Navigate to "/sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Experience/"
Create "Versions" item like this, http://imgur.com/bPEDm7R
Create "Compare" item under "Versions" like this, http://imgur.com/dG8dz2M
The result like this, http://imgur.com/HPu3XAL
The content author can see which version they are using and they can also compare with previous versions.

Sitecore Broken Links and Content Editor Issues

We've been noticing an increase in number of broken links on our sitecore website.
Some it is due to
User Training
Publishing Issues (linked page is not yet published)
Maybe content editor issues
It's been hard to verify some of these but sometimes the link might have the authoring page URL (which means someone didn't follow the SOP), sometimes they have a strange url like /shell/Content Editor/...
So we are trying to proactively fix these before the pages go live.
I had a couple ideas like writing a Handler that would look through all "Rich Text Fields" and looking for inconsistencies (like authoring server URL). Also using a crawler-type of validator could help us (http://home.snafu.de/tilman/xenulink.html#Description) but we were wondering what the community was doing to address this issue.
The "internal link checker" usually works well but doesn't detect many of this erroneous setups (as I believe it sees them as 'external links').
Your input is greatly appreciated!
If you have RichText fields and create internal links, your internal link looks like this in the HTML view: "a href="~/link.aspx?_id=EB3AD128E7BF4F3C9F3812F701D7724E&_z=z" and when you hover with your mouse over it, is show "/Sitecore/Shell/Controls/Rich Text Editor/" before the ~/link.aspx. This is normal behavior. This link is modified to a normal link during rendering of the RTE field.
However, be sure to use the Sitecore controls like to render these RTE fields and to render links. Also using sc:fld() in XSLT instead of sc:field() can create strange links because sc:fld is rendering the raw value of the field.
In all of the Sitecore projects I have been working on, I didn't have much issues with broken links.
There is a known bug with copy-pasting links from a rich text editor, where path info is appended to the link (generating the /shell/Content Editor/ stuff).
Sitecore have a fix for it here:
http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/KnownIssues%20Recommended/Copying%20and%20pasting%20link%20in%20rt%20fields%20may%20break%20the%20link.aspx
I would suggest a new Validation Action added to the workflow command before the items are finalized. Then you could actively stop them from being published and give immediate feedback. If you're not using workflows, you could add a new item level validator, but those often get ignored in my experience -- too many false positives on the existing validators.