Try our conversational search powered by Generative AI!

Picking Block in Dynamic Content


Is it even possible right now.  Right now what i am doing is I have a content area on the page type and not in the view.  This allows the editor to select the content area from the page property dc and it renders just fine.  I am curious if there is a dynamic content area where the user can select a block.  Thanks in advance

Nov 09, 2012 3:29

Hello Joshua!

Unfortunately there is no solution (at least that I know of) for this right now. Our intents was and still is to merry dynamic content and blocks since there is really not a need for both of these technologies. Since we did not have time to do this I intend to see if I can find some sort of support for this until we make this possible but I have not had time for this yet...

Nov 09, 2012 7:46

Thanks Linus, I was going crazy trying to figure it out.  I appreciate the response.  Not sure who is responsible for the forum but when i try to mark this item as answered, i am asked to signup or login.  weird.

Edited, Nov 10, 2012 4:00

Any updates on this one? We just ran into a situation where we would like to be able to select blocks from a Dynamic Content and the solution right now is to point a PageReference from the Dynamic Content to a page type with only a ContentArea where the blocks are placed. We ended up with this because the customer wants to be able to place blocks inside the "main body".

Thanks for you help!

Jan 23, 2013 9:48

I have done a proof of concept where I have inserted a content fragment (basicaly a reference to a content item) inside a Tiny MCE. While this works technically there are some improvements that needs to be done to get this into production shape. First of all, I needed the Tiny MCE upgrade to get generic support for non-editable-areas inside Tiny MCE. The upgrade is now done but I have not gotten the time yet to finalize this. I hope to be able to get this into the Sparrowhawk upgrade planned for Q1 but there is a risc that the final solution needs changes to the episerver assembly which would postpone this until the next framework release later this year. I'll post here as soon as I know more...

Edited, Jan 23, 2013 14:39

For anyone following this thread: I have just checked in support for dragging a block into a content area. Unless something is found during testing this will be part of the Sparrowhawk 7.1-upgrade that will be release in Q1 this year.

Jan 28, 2013 16:18

Great Linus!

So this means that you can drag blocks to a dynamic content dialog or that you can drag it to the editor itself?

Jan 28, 2013 16:21

You will be able to drag it directly to the editor, pretty much the same way as you would for a content area.

Jan 28, 2013 17:47

Linus, I can't get this to work in the newly released 7.1?

Apr 10, 2013 14:44


This feature is actually in the release, but there are a few bugs in the EPiServer core that made us take the decision to hide it by default. It's possible to enable it quite easilly and hopefully we can fix the issues in the next core patch. I'll post the code needed to activate this below but first let's go through the bugs:

  1. No access rights filtering on blocks/content inside an xhtml string.
  2. No filtering for publishing start and stop dates.
  3. No resursivity check for items. That means you can drag a reference to yourself and crash the page/block using it.
  4. Relating to an item that has been permanently deleted (even from the wastebasket) might cause an exception.

Given that you accept the flaws above and/or that we release a patch that fixes these issues you can enable this feature by doing two things. The first is to add an editor descriptor that extends/overrrides the meta data for the default descriptor:

using System;
using System.Collections.Generic;
using EPiServer.Core;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;

namespace Samples
    public class ExtentionXhtmlStringEditorDescriptor : EditorDescriptor
        public override void ModifyMetadata(EPiServer.Shell.ObjectEditing.ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
            metadata.EditorConfiguration["AllowedTypes"] = new[] { "fileurl", "link", "epi.cms.content.light" };

You might have noticed that we are lacking the EditorDescriptorRegistration attribute for the descriptor. The reason for this is that editordescriptors are executed as a list for a given type/ui-hint. There is currently no control of the order of execution for EPiServer 7.0 (this has been added for the next framework release). So to ensure that our descriptor is called after the default descriptor we register it manually in an initialization module. This is done like this:

public void Initialize(Framework.Initialization.InitializationEngine context)
    //Other initialization

    var metadataHandlerRegistry = ServiceLocator.Current.GetInstance<MetadataHandlerRegistry>();
    metadataHandlerRegistry.RegisterMetadataHandler(typeof(XhtmlString), new ExtentionXhtmlStringEditorDescriptor());

In the next framework release this should be enabled by default and you should remove the code above.

Edited, Apr 11, 2013 13:13

Hi Linus!

We have installed 7.1 now. Should it work do drag n drop blocks into the editor now or do we still need to insert the code above?


Edited, Apr 23, 2013 10:21


You need to validate that you accept the bugs/flaws mentioned above and then insert the code above to activate this.

Apr 23, 2013 10:50

Hi Linus.

I cannot get this to work. I tested both in my project and in the Alloy example site. I have contacted the EPiServer support team and the told me to ask you here why your example doesn´t work. So, that´s what I´m doing :)

I have the 7.1 version.

The Init seems ok because the metadata.EditorConfiguration["AllowedTypes"]  is set everytime I edit my pages.


May 13, 2013 14:59

Hmm, work on my 7.1-site. Has anyone else got this to work?

Does your initialization module have any dependencies to any of the EPiServer modules? If you do a call to metadataHandlerRegistry.GetMetadataHandlers(typeof(XhtmlString)); before registering your handler should give you a list with an instance of XhtmlStringEditorDescriptor inside it. Just want to make sure that your handler is added after the default one.

May 15, 2013 18:39

OK, thanks, I will try it.

But as the support team says, this feature is not yet supported by EPiServer, so we don´t dare to use it just yet...

May 16, 2013 8:53

Yes I have a XhtmlStringEditorDescriptor when I call GetMetadataHandlers. It this good or bad? Should it work now?

May 21, 2013 13:44

@Linus: I've tried your code but don't get it to work. Blocks can't be dropped in editors. Any ideas how to troubleshoot?

Sep 03, 2013 17:48

I was trying this "drag'n'drop block to editor with given code without success either. Anyone else than @Linus got this working?

Sep 18, 2013 13:56

@Linus: Will this new drag'n'drop of blocks into editors be a working feature in the new EPiServer 7.5 CMS release?

Oct 11, 2013 14:17

Yes, this will be part of 7.5 and we should hopefully have fixed all known issues until then. That's the main reason (except of lack of time) that I have not spent time investigating this further in 7.1.

Oct 11, 2013 14:49

Great. Is there a release date for 7.5?

Edited, Oct 11, 2013 16:49

@Linus: Did this feature make it to the release of EPiServer 7.5?
I cant find anything in the release notes.

Nov 03, 2014 12:51

Yes, I don't think it got listed in the release notes for some reason but I've blogged about it here:

Nov 04, 2014 8:37

Perfect! Thanks for that :)

Nov 04, 2014 10:52
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.