I want to make choices for content items based on my tag values.
For example, I want to make an alternate call to do searching the net for me a new thus, I have the However, after this what do I do with it? How do I add alternate names? And is it necessary to create a new alternative type? Orchard will look to see the I saw some orchard source took a cue commented Bertrand Direction Here's my implementation:. This is an optional view based on a tag value. So, if you have a project page that you want to apply to a specific style, you can create your own alternative view with just the name Update I list-projectionpage-tag-specific
ShapeDisplayEvents to apply
public class TagAlternatesFactory: ShapeDisplayEvents {public TagAlternatesFactory () {} public override void display (ShapeDisplayingContext context) {}}
method displays, I believe I have a contentItem off context.Shape Please check and make an alternate name based on that (assuming it has been added to the TagsPart content item).
list-projectionpage-tag-specific ?
public class TagAlternatesFactory: ShapeDisplayEvents {public override void display (ShapeDisplayingContext context) {context.ShapeMetadata.OnDisplaying (displayedContext = & gt; {var contentItem = displayedContext.Shape.ContentItem; var contentType = contentItem .ContentType; ContentPart & gt ;; if (parts == null; var parts IEnumerable of & lt as = contentItem.Parts) return; Var tags (part = & gt; part of the tag part) as the tag; if (tag part == null) return; foreach (tag tag var.CurrentTags) {displayContext.ShapeMetadata.Alternates.Add (String.Format ( "{0} __ {1} __ {2} __ {3}", displays Contex. Showpate MetatataT See the update;};}}
ProjectionPage_tag_special and at any time you launch Want to use the page, just add it to
special this Tag.
displayed the content box. Shapamatadata Type for the alternative name so that the specific size is overrun (like the list-launch page)
No comments:
Post a Comment