public override void Displaying(ShapeDisplayingContext context) { context.ShapeMetadata.OnDisplaying(displayedContext => { if (!IsActivable()) { return; } if (context.ShapeMetadata.Type != "EditorTemplate" && context.ShapeMetadata.Type != "Zone") { return; } ContentItem contentItem = context.Shape.ContentItem; // if not, check for ContentPart if (contentItem == null) { ContentPart contentPart = context.Shape.ContentPart; if (contentPart != null) { contentItem = contentPart.ContentItem; } } var className = "content-" + _workContext.GetTextDirection(contentItem); if (!_workContext.Layout.Content.Classes.Contains(className)) { _workContext.Layout.Content.Classes.Add(className); } }); }
public static string GetTextDirection(this WorkContext workContext) { return(workContext.GetTextDirection(null)); }