Difference between a widget and a content part?

Dec 27, 2010 at 3:22 PM

I'm trying to get a better understanding of the differences between a content part and a widget. From the documentation, it seems that a widget is just a content part inside of a UI zone. Could anyone give me a little more detailed explanation of the differences (maybe at what point the framework creates or interacts with these entities, or how they are related to each other)?

Dec 27, 2010 at 6:38 PM

Technically, widgets are instances of content types that have the widget content part and the widget stereotype. Functionally a widget is a content item that can be injected into a zone. Even more generally they are pieces of UI that you can put into zones. Does this help?

Dec 27, 2010 at 7:44 PM

That does help clear it up (and I found the tutorial on converting the MapPart to a MapWidget). This gives me a couple of new questions:

  1. At what point would you decide to make a part a widget? I'm guessing when I want a "designer" to place the part somewhere on a page, rather than have the content type and placement.info dictate where it belongs?
  2. Does being a widget make the part stay in the same zone on every page (if I wanted to have a simple location displayed in the same zone on every page, I might make the MapPart a MapWidget)?
  3. Does the placement.info file get ignored for a widget?
  4. Can a widget still be added to a content type as a part?

Additionally, in trying to fully understand the placement of parts, the placement.info file and description under it in this tutorial http://www.orchardproject.net/docs/Writing-a-content-part.ashx has me confused.

    <Place Parts_Map="Content:10"/>
    <Place Parts_Map_Edit="Content:7.5"/>

I understand the first node fine (Content:10 puts the part in the 10th position of the "Content" zone). However, the second node makes no sense to me (maybe it's a typo). It says that Content:7.5 means the editor template will go into the "Primary" zone in the 2nd position? And, what's with the .5? Does that mean positions are doubles (7.4 < 7.5 < 7.6)?