Showing posts with label Page Editor. Show all posts
Showing posts with label Page Editor. Show all posts

Wednesday, February 22, 2012

Cascading renderings in Sitecore Page Editor [Experimental]


Ok, here is something completely experimental. Consider the following real world example from Sitecore’s website. You have a section called “Customers” and you have a left rail where the leftnav typically sits. Now your marketers want the “call-to-action” rendering to be placed below the leftnav:
 SNAGHTML9837b0a

…and what’s important, have it cascade to all child pages (let’s take this as an example).
Another thing they want to make sure is to lock it down on those child pages so nobody can do anything with it in Page Editor (move, change properties, etc,)

Pretty interesting scenario, heh?

Sunday, November 27, 2011

Hidden Gem of Sitecore Page Editor


During performance profiling of Page Editor I’ve noticed that the “My Items” button was taking a lot of CPU time to render. ANTS Performance Profiler was very kind to tell me that with no hesitation.

Monday, October 25, 2010

Undefined text in Page Editor when clearing field


Greetings!

You may be experiencing an issue with Page Editor in Sitecore 6.1/6.2 releases when clearing a field results in “Undefined” text being written back to your item.

To work this around, follow these 3 easy steps.

1. Locate the following file: <web root>\sitecore\shell\Applications\WebEdit\WebEditElement.js
Create a backup copy of it.

2. Find the following function: Sitecore.WebEdit.Element.prototype.load = function() and replace it with this:

Sitecore.WebEdit.Element.prototype.load = function() {
  if (this.element.getAttribute("scWatermark") == "true") {
    this.element.removeAttribute("scWatermark");
    this.watermarkHTML = this.element.innerHTML;
  }else
  {
  this.watermarkHTML = "[No text in field]";
  }
this.buttons.select(".scWebEditFrameButtonIcon").each(function(icon) {
    icon.observe("dragstart", function(e) { e.stop(); });
  });
  this.element.observe("click", this.onClick.bind(this));
  this.element.observe("blur", this.onBlur.bind(this));
}

3. Then locate this function: Sitecore.WebEdit.Element.prototype.isWatermark = function() {
and replace it with this:

Sitecore.WebEdit.Element.prototype.isWatermark = function() {
  fl=false;
  if((this.watermarkHTML == this.element.innerHTML)||(this.element.innerHTML=="[No text in field]"))
               {
               fl=true;
               }
  return fl;
}

Quick disclaimer: this proved working on my local 6.2.0 (rev. 100831) installation, however, this is not a fully tested solution, so there may be conflicts depending on exact version of your Sitecore instance and level of customization.

Thanks goes to Sitecore Customer Service for quick solution!

Friday, March 13, 2009

Friday Catch: Page Editor Not Yet Available


You may be getting this message in Page Editor after clicking any of the top bar buttons (Edit, Design, Log off).
In my case it is caused by the System.Web.UI.WebControls.ImageButton control's PostBackUrl property which I am assigning in code behind.
It appears that any control with that property assigned and used such as asp:LinkButton, asp:Button cause this problem on SR-1 installations and presumably earlier too.
To workaround it, I added a check for IsPageEditor in my control:
if (!Sitecore.Context.PageMode.IsPageEditor)
{
imageButton.PostBackUrl ="/mypage.aspx";
}
Works as temp workarond, the tech support will be investigating further.

Thursday, January 08, 2009

jQuery conflicts with PageEditor


There is such problem, indeed. It is caused by the conflict with Prototype.js that most of Page Editor, including designer and debugger uses. It can be simply worked around by overriding the $-function by calling "jQuery.noConflict()".
<script type="text/javascript" src="/js/jquery-1.2.6.js"></script>
 
<script type="text/javascript">
 
var $j = jQuery.noConflict();
 
      $j(document).ready(function() {
 
      });
 
</script>
More about that on the jQuery website.