This project is read-only.

Widget part not attachable... why?

Topics: General
Jun 5, 2012 at 12:50 AM

I'm wanting 2 flavors of the HTML Widget, one with the WYSIWYG editor, and one without an editor (just an empty textbox)

The annoying thing is that the HTML widget by default sets the body flavor for every instance of the widget.

I figured the easy solution to this problem would be to create a new content type "Raw HTML Widget" add the body and widget parts and set the stereo type all in the content types admin...

Only issue is that the Widget type is not attachable... I assume this is for a reason?

I've did a workaround of exporting the HTML Widget, renaming it to Raw HTML Widget and importing.

Jun 5, 2012 at 12:52 AM

Aren't you able to change it using the new check box in the part editing ?

Jun 5, 2012 at 12:53 AM

Well, you might still be limited by not being able to mark the type as stereotype widget. This is ok in Orchard 1.5 though (current 1.x branch)

Jun 5, 2012 at 1:03 AM

I can't / don't see the option to edit the WidgetPart to be attachable.

I can however set the stereo type for my new content type "Raw HTML Widget" to be Widget, this gets it to display in the list of selectable widgets but throws an exception when I try to use it.

Jun 5, 2012 at 1:06 AM

Please file a bug for the missing attachable option. But you need to explain to me how you define the stereotype.


Jun 5, 2012 at 1:10 AM
Edited Jun 5, 2012 at 1:13 AM

Will file a bug.

For the stereo type... if you click edit on any content type, its has a text box:


<fieldset> <label for="ContentTypeSettingsViewModel_Stereotype">Stereotype</label> <input id="ContentTypeSettingsViewModel_Stereotype" class="textMedium" name="ContentTypeSettingsViewModel.Stereotype" type="text" /> (Optional) The stereotype of the content type. e.g., Widget, MenuItem, ... </fieldset>




(Optional) The stereotype of the content type. e.g., Widget, MenuItem, ...

Damm, this html above looks fine until I click save...

Jun 5, 2012 at 1:12 AM

Oh, did I put it in 1.4.2 or are you using 1.x ?

Jun 5, 2012 at 1:21 AM
Edited Jun 5, 2012 at 1:21 AM

Jun 5, 2012 at 1:22 AM

I'm using the Tip of 1.x

Jun 5, 2012 at 1:25 AM

Would you create a patch for it ? 

It's in Orchard.ContentTypes.Settings.EditorEvents right now and ContentTypeSettingsViewModel.cshtml

It should be replicated for Parts+Attachable

Jun 5, 2012 at 1:31 AM

Sure, will do it in the next few hours...