Orchard Templates

Topics: Writing themes
May 10, 2012 at 12:10 PM

Hey,

I am having a little difficulty with using alternates. I basically have a projection widget that displays a picture and the title of the content item. All good. However the client just added a content item with a ridonkulously long title which, as you can imagine, has fucked it all up.

I am using the summary title, this is my placement file:

<Match DisplayType="FeaturedList">
	<Place Fields_MediaPicker-Thumbnail="Thumb:1" />
	<Place Parts_Title_Summary="Title:1" />
	<Place Fields_Contrib_TaxonomyField-Type="Type:1" />
</Match>

I basically want to overwrite the summary title view when it is rendered in my projection widget. Is this possible?

Developer
May 10, 2012 at 1:15 PM
Edited May 10, 2012 at 1:15 PM

Doesn't the Shape Tracer tool show you some alternates for the Parts_Title_Summary shape which you can override when displaying in that widget?

May 10, 2012 at 4:08 PM

Yes, but they only give me options using the url or the specific contentItem, but I kind of would like to be able to just do it for all titles rendered in the projection widget. I have just been sneaky and useless and made the font of the title smaller so it fits in the widgets box, because I couldn't work out a simple way of overriding that shape, maybe I need to look at using properties, or not even bother using the title shape, but I don't particularly want to do that. I like it to be nice and neat :D

Coordinator
May 10, 2012 at 6:09 PM

You can define a template for the whole content item summary by specifying another Display Type in the Layout. Something line Content-YOURTYPE.MyOwnSummary.cshtml.

Or you could also use Properties, and then apply a Limit to the title property.