Sana Assistant (online)
Table of Contents

IExtensionViewHelper reference

This article provides reference material about IExtensionViewHelper.

IExtensionViewHelper interface provides methods that are needed to render standard Sana elements.

Methods

FormatAsPercentage(decimal value, string currencyId = null)

Gets a formatted percentage.

@Extension.FormatAsPercentage(item.DiscountPercentage)

FormatAsPrice(decimal price, string currencyId = null, bool includeCurrencySymbol = true)

Gets a formatted price.

@Extension.FormatAsPrice(Model.Amount)

RichText(string groupCode)

Gets resource text as HTML including HTML tags and newline characters.

<div class="error-block">@Extension.RichText("ErrorPage_ErrorText")</div>

SimpleText(string groupCode)

Gets resource text as HTML but without any HTML tags and newline characters.

<span class="msg-not-available">@Extension.SimpleText("Product_NotAvailable")</span>

AdminText(string key)

Gets text from the admin resource file.

@Extension.AdminText("OrderId")