Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KayeeNL/8fdb067619f7b4e955f5d476e677bb34 to your computer and use it in GitHub Desktop.
Save KayeeNL/8fdb067619f7b4e955f5d476e677bb34 to your computer and use it in GitHub Desktop.
kayee-blogpost-sitecore-dictionary-service-contentblock-example.cshtml
@using KayeeDictionaryServiceDemo.Services.Dictionary.Models
@model ContentBlock
@inject IServiceProvider ServiceProvider
@{
bool isReuse = ViewBag.IsReuse ?? false;
var dictionaryModel = new DictionaryModel(ServiceProvider);
}
<h1>Here are translations from Dictionary Items:</h1>
<p>
@dictionaryModel.GetDictionaryPhrase("Documentation", "DOCUMENTATION")
</p>
<p>
@dictionaryModel.GetDictionaryPhrase("GraphQL", "GRAPHQL")
</p>
<p>
@dictionaryModel.GetDictionaryPhrase("Styleguide", "STYLEGUIDE")
</p>
<p>
@dictionaryModel.GetDictionaryPhrase("styleguide-sample", "STYLEGUIDE-EXAMPLE")
</p>
@if (isReuse)
{
<div class="col-sm">
<div class="contentDescription">
<sc-text asp-for="Content"/>
</div>
</div>
}
else
{
<h2 class="display-4" asp-for="Heading"></h2>
<div class="contentDescription">
<sc-text asp-for="Content"/>
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment