November Happy Hour will be moved to Thursday December 5th.

Customize contentarea rendering in edit?

Vote:
 

Hi,

Is it possible to customize the rendering of the contentarea in editmode? i need to remove the "You can drop content here, or create a new block" section and stil keep the drag and drop functionality.

Any ideas?

Thanks
Jesper

#80731
Jan 30, 2014 15:32
Vote:
 

I love to know that too!

#89765
Aug 25, 2014 18:03
Vote:
 

Take a look at this blog post: custom rendering of content areas.

Frederik

#89769
Aug 25, 2014 20:32
Vote:
 

This way do not break the content area, it merely hide the "actionContainer" through css, so it should *cough* never break any funtionality:

Create a custom editor descriptor, like so:

	/// 
	/// Hides the "you can drop content here..." part of a content area when rendered in edit mode
	/// 
	[EditorDescriptorRegistration(TargetType = typeof(ContentArea), UIHint = "HideContentAreaActionContainer")]
	public class HideActionContainerContentAreaEditing : ContentAreaEditorDescriptor
	{
		public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
		{
			base.ModifyMetadata(metadata, attributes);
			metadata.OverlayConfiguration["className"] = "hideActionContainer";
		}
	}

Apply it to a property:

		[UIHint("HideContentAreaActionContainer", PresentationLayer.Edit)]
		public virtual ContentArea MyContentArea { get; set; }

Add a edit mode css file in module.config:


		
	

Add the styling to hide the area in /clientresources/styles/styles.css:

.hideActionContainer .epi-overlay-blockarea-actionscontainer {
	display: none!important;
}
#91614
Oct 09, 2014 13:35
Vote:
 

Cannot get this to work.

The metadata.OverlayConfiguration["className"] = "hideActionContainer"

does not seem to write the class on the dom element.

EDIT

Currently on episerver version 7.18 (dll)

 

#113998
Edited, Dec 02, 2014 16:49
Vote:
 

What we did in one project is we just overwrote the UI text "you can drop..." With our own version as the link to create new block was embedded to that UI text that can be found from recourse xml files embedded to episerver dll.

Not elegant sure but worked :)

#114016
Dec 02, 2014 22:19
Vote:
 

Hi Janne:

I cannot owerrite the lang file since this is to occur only on one block.

Not system wide

#114023
Dec 03, 2014 8:21
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.