Skip to main content

Razor Blade Tutorials

Tutorial HomeRazor.Blade

RazorBlade set Title, Description and other headers v1.1

This page sets the title, description, keywords and some manual tags to the header. Look at the resulting output-source to see the effect.

Source Code of this file

Below you'll see the source code of the file. Note that we're just showing the main part, and hiding some parts of the file which are not relevant for understanding the essentials.

@inherits ToSic.Sxc.Dnn.RazorComponent
@using ToSic.Razor.Blade;
<!-- unimportant stuff, hidden -->
RazorBlade set Title, Description and... <!-- unimportant stuff, hidden -->

@{
  HtmlPage.Title = "Title changed from the razor using Razor Blade! original: " + HtmlPage.Title;
  HtmlPage.Description = "Learn to use Razor Blade " + HtmlPage.Description;
  HtmlPage.Keywords = "Tutorial, Razor, Blade" + HtmlPage.Keywords;
  HtmlPage.AddToHead("<meta xyz>");
  HtmlPage.AddMeta("somename", "somevalue");
}

<!-- unimportant stuff, hidden -->