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

  • Home
  • SEARCH
  • 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 7825983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:13:42+00:00 2026-06-02T09:13:42+00:00

I built a custom module that manages appointments for a service-based company. All of

  • 0

I built a custom module that manages appointments for a service-based company. All of the current functionality is contained in the admin section. I have not used a single ContentItem or ContentPart. All the models are just plain records.

I’m looking to create a widget to expose the ability to sign up for an appointment from the front end. I have a partial view and a controller that handles the display and form submit, but I’m not sure how to tie that into a widget that can be placed in one of the content zones of the front-end.

I’ve spent quite a bit of time researching this, and can’t find a good path to follow. (I’ve tried a few and got sub-optimal results)

Any suggestions?

  • 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-02T09:13:44+00:00Added an answer on June 2, 2026 at 9:13 am

    The best answer for me was to create a widget Type definition in the migration.cs file of the module:

    ContentDefinitionManager.AlterTypeDefinition("CreateAppointmentWidget",
        cfg => cfg
            .WithPart("WidgetPart")
            .WithPart("CommonPart")
            .WithSetting("Stereotype", "Widget"));
    

    Then create a handler for that widget at /MyModule/Handlers/CreateAppointmentWidgetHandler.cs:

    public class CreateAppointmentWidgetHandler : ContentHandler
    {
        private readonly IRepository<FieldTechRecord> _repository;
    
        public CreateAppointmentWidgetHandler(IRepository<FieldTechRecord> repository)
        {
            _repository = repository;
        }
    
        protected override void BuildDisplayShape(BuildDisplayContext context)
        {
            base.BuildDisplayShape(context);
    
            if (context.ContentItem.ContentType == "CreateAppointmentWidget")
            {
                CreateAppointmentViewModel model = new CreateAppointmentViewModel(_repository.Fetch(x => x.IsActive));
                context.Shape.AppointmentModel = model;
            }
        }
    }
    

    Then create a matching widget template at /MyModule/Views/Widget-CreateAppointmentWidget.cshtml that inserts the Partial View:

    @Html.Partial("CreateAppointment", (MyModule.Models.Views.CreateAppointmentViewModel)Model.AppointmentModel)
    

    The above code grabs the partial view /MyModule/Views/CreateAppointment.cshtml.

    Thanks to Giscard’s suggestion, I was able to correct the links rendered from CreateAppointment.cshtml by using @Url.RouteUrl() and defining named routes to point where I needed the action and ajax requests to go.

    The nice thing about this solution is that it provided a way to create the widget without having to rework my models to use Orchards ContentPart functionality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a custom-built Flash-based video player that I maintain, and it needs to
I have a custom built ajax [div] based dynamic dropdown. I have an [input]
I use a custom-built asp.net control that renders to a DIV and has height='0'
I've built a custom UI for my table that has a darker UI and
I have built a custom membership provider that I have used in a previous
I have a module that is used by creating a custom class loader. The
I have a form in a custom Drupal 6 module built with the Form
I'm working on a custom CMS that another developer built a few years ago.
I built a custom forum for my site using MySQL. The listing page is
I've built a custom login system for my asp.net mvc 1.0 web application as

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.