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 6751551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:56:26+00:00 2026-05-26T12:56:26+00:00

I am trying to build a theme (convert an existing template I have) in

  • 0

I am trying to build a theme (convert an existing template I have) in Orchard but I got stuck when styling the Blog Archives widget. I have a zone “sidebar” in which I placed the widget.

In order to have it output the markup I want I created a new template in my views folder: Widget-BlogArchives.cshtml All the template does it wrap the content of the widget in a div like so:

<div class="box box_small">
    @Display(Model.Content)
</div>

So I expected all the widget content to be inside my div. However the generated HTML looks like this:

<article class="widget-blog-archives widget" shape-id="15">
  <header shape-id="15">
    <h1 shape-id="15">The Archives</h1>
  </header>
  <div class="box box_small" shape-id="15">
    <div class="archives" shape-id="16">
      <ul class="archiveMonthList" shape-id="16">
        <li class="first last" shape-id="16">
      <a href="(shortened)/10" shape-id="16">October 2011 (1)</a>
    </li>
  </ul>
    </div>
  </div>
</article>

What I don’t understand is where the whole article wrapping is coming from? How can I get the header into my div and change the to a ?

Could someone also please explain where in the Model the title “The Archives” is stored? I looked through the model in the shape tracing tool but couldn’t find it…

Thanks.

UPDATE

As Bertrand explained I made some changes to my Widget-BlogArchives.cshtml:

@using Orchard.ContentManagement
@using Orchard.Widgets.Models
@{
  Model.Metadata.Wrappers.Clear();
  var title = ((IContent)Model.ContentItem).As<WidgetPart>().Title;
}
<div class="box box_small">
  <h3>@title</h3>
  @Display(Model.Content)
</div>

This now generates the HTML I want.

  • 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-05-26T12:56:27+00:00Added an answer on May 26, 2026 at 12:56 pm

    This markup comes from the widget wrapper. It is possible to suppress the wrapper by calling Model.Metadata.Wrappers.Clear(). You can then completely take over the rendering from your own widget override.

    If you open widget.wrapper.cshtml, you’ll find the answer to your second question:

    var title = ((IContent)Model.ContentItem).As<WidgetPart>().Title;
    

    Which could also be done this way:

     var title = Model.ContentItem.WidgetPart.Title
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to convert an existing Android build system using Ant with 'ant_rules_r3.xml' integration from
I am trying to build a theme right now for the Spree eCommerce platform
I got a project with 49 source files that I'm trying to convert to
I'm trying to convert a Netbeans 6.9.1 project into a scripted build (without netbeans).
I am trying to convert an existing .Net shop site to an Android app.
I'm trying to build my own custom django form widgets (putting them in widgets.py
We are trying to build a High-Volume Orders Record System. There are three primary
I'm trying to see if there is a way to build a Linq statement
I'm trying build a method which returns the shortest path from one node to
Trying to build a GUI application in Java/Swing. I'm mainly used to painting GUIs

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.