Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9103945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:44:53+00:00 2026-06-17T01:44:53+00:00

This time I’m struggling with my custom widget for Orchard. It’s a simple content

  • 0

This time I’m struggling with my custom widget for Orchard.
It’s a simple content part with two fields:
– Background Color
– Size

I want to be able to add HTML content to this widget; so I added the Body Part. This part must be displayed within my widget. The result should be something like this:

<div class="size-small bg-color-red"> BODY PART HTML CONTENT </div>

But unfortunately, the Body Part is always displayed before or after my widget.

<Placement>
    <Place Parts_ContentTile="Content"/>
    <Place Parts_ContentTile_Edit="Content:7.5"/>
</Placement>

Not so nice ‘solution’:
A way to resolve this is to remove the body part and replace it with a simple text field. This text field is rendered at the desired position. But then the TinyMCE Editor is not available.

Update after comment from Ivan:
I tried to change both (Content Type and Content Part (separate)) but unfortunately, both times, the TextField content is displayed after the widget. Should that be fixed in the Placement.info?

Another option is to add a String field to my Widget Model. But then it is not possible to show the TinyMCE editor. Am I right?

So I’ve got the feeling that my expectations about widgets, content parts and placements are incorrect. Hopefully somebody here can point me in the right direction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:44:54+00:00Added an answer on June 17, 2026 at 1:44 am

    This post on SO from Mark Z was really helpfull to me!

    I added a String property to my Model and added a new Database Migration:

    public int UpdateFrom3()
    {
       // Adds a new Content column
       SchemaBuilder.AlterTable("ContentTileRecord", table => table.AddColumn("Content", DbType.String));
    
       return 4;
    }
    

    After that I added the field to the Editor Part View:

    @Script.Require("OrchardTinyMce")
    
    <div class="editor-label">
       @Html.LabelFor(model => model.Content)
    </div>
    
    <div class="editor-field">
       @Html.TextAreaFor(model => model.Content, new { @class = "html tinymce" }) 
    </div>
    

    The Content Property is now displayed as a TextArea. Because of the classes ‘html and tinymce’ the TinyMCE editor is instantiated. (Don’t forget the Script.Require call)

    Because of the fact that the Content property contains HTML, it is required to use the @Html.Raw helper to display the value of this property.

    @Html.Raw(Model.Content)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this time i have a simple question: I have one table, related with himself
I believe my question this time is simple. Let say I have a webpage,
this time someone should please relpy i am struggling with running my code using
Simple question this time, is there a way in ASP.NET to set a decimal
This time my test code displays a TextBox and two TextBlocks. The TextBox and
This time I'm struggling with the different methods to bind events. I've all the
This time I have problem with virtual fields. I have core class for my
This time I have problem with virtual fields. I have core class for my
C++ question this time. I'm trying to store the product between two random numbers...
This is probably a very simple question, but at this time I have myself

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.