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...
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.
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!
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...
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.
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?
You will be able to drag it directly to the editor, pretty much the same way as you would for a content area.
Hi!
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:
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.
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?
Thanks!
Hi!
You need to validate that you accept the bugs/flaws mentioned above and then insert the code above to activate this.
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.
/R
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.
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...
Yes I have a XhtmlStringEditorDescriptor when I call GetMetadataHandlers. It this good or bad? Should it work now?
@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?
I was trying this "drag'n'drop block to editor with given code without success either. Anyone else than @Linus got this working?
@Linus: Will this new drag'n'drop of blocks into editors be a working feature in the new EPiServer 7.5 CMS release?
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.
@Linus: Did this feature make it to the release of EPiServer 7.5?
I cant find anything in the release notes.
Yes, I don't think it got listed in the release notes for some reason but I've blogged about it here: http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2013/12/Customizing-the-look-and-behavior-in-the-UI-for-your-content-types/
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