ability to add arbitrary content to head and body during client and server rendering

This commit is contained in:
sbwalker
2023-05-15 16:43:22 -04:00
parent 7f7dff7019
commit dbe7324c7f
6 changed files with 131 additions and 37 deletions

View File

@ -273,6 +273,35 @@ namespace Oqtane.Modules
SiteState.Properties.ModuleVisibility = obj;
}
public void SetPageTitle(string title)
{
SiteState.Properties.PageTitle = title;
}
public void AddHeadContent(string content)
{
if (string.IsNullOrEmpty(SiteState.Properties.HeadContent))
{
SiteState.Properties.HeadContent = content;
}
else if (!SiteState.Properties.HeadContent.Contains(content))
{
SiteState.Properties.HeadContent += content;
}
}
public void AddBodyContent(string content)
{
if (string.IsNullOrEmpty(SiteState.Properties.BodyContent))
{
SiteState.Properties.BodyContent = content;
}
else if (!SiteState.Properties.BodyContent.Contains(content))
{
SiteState.Properties.BodyContent += content;
}
}
// logging methods
public async Task Log(Alias alias, LogLevel level, string function, Exception exception, string message, params object[] args)
{