- Customize the ExperienceEditor Part 1 - Include your custom JS
- Customize the ExperienceEditor Part 2 - Override the Sitecore functions in the JS
- Customize the ExperienceEditor Part 3 - Accessing to the registry from the javascript
If you need to save boolean into the registry like the collapsed state of an element to keep the content editor's preferences you can do:
Retreive the current state:
Sitecore.ExperienceEditor.PipelinesUtil.generateRequestProcessor("ExperienceEditor.ToggleRegistryKey.Get", function (response) { mystate = response.responseValue.value; },{ value: "/Current_User/Page Editor/MyModule/MyValue" }).execute();Where
- function(response) is the function executed when you will receive the response.
- response.responseValue.value is a boolean with the returned value. The default value of this registry is true (stored as "on" in the registry)
- MyRegistryKey.IsCollapsed is the a unique key in the registry for the user.
Toggle the value when the user collapse the control for example
Sitecore.ExperienceEditor.PipelinesUtil.generateRequestProcessor("ExperienceEditor.ToggleRegistryKey.Toggle", function (response) { top.sidebar.isCollapsed = response.responseValue.value; }, { value: "/Current_User/Page Editor/MyModule/MyValue" }).execute();
You can use the same method to call the different requests commands from the Sitecore config node sitecore.experienceeditor.speak.requests who are stored by default in Sitecore.ExperienceEditor.Speak.Requests.config
Bhai hmm nhi aaa..
ReplyDelete