Created
January 2, 2024 14:29
-
-
Save KayeeNL/8fdb067619f7b4e955f5d476e677bb34 to your computer and use it in GitHub Desktop.
kayee-blogpost-sitecore-dictionary-service-contentblock-example.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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