Posted on 18/11/2025 17:05:04
Why do you need it? can you explain what you use it for - my guess is there are new and better ways to do it.
The method looks like below - and if there is now current paragraph it will return an empty string. The actual renderer exposes paragraph information on the paragraph you are rendering - so it has to be there. This change has happened as part of hardening the nullable situation. To avoid exceptions.
You might be able to force a version to work like this:
PageView.Current.CurrentParagraph = new();
@RenderItemList(...)
But I would recommend to do something else.
public object RenderItemList(object settings)
{
ArgumentNullException.ThrowIfNull(settings);
if (Context.Current is null)
{
return string.Empty;
}
var pageView = PageView.Current();
if (pageView is null)
{
return string.Empty;
}
var paragraph = pageView.CurrentParagraph;
if (paragraph is null)
{
return string.Empty;
}
var values = GetNameValueCollection(settings);
var args = new System.Text.StringBuilder();
foreach (var key in values.AllKeys)
{
if (args.Length > 0)
{
args.Append(";");
}
args.AppendFormat("{0}:{1}", key, values[key]);
}
var cm = new Frontend.ItemPublisher.Frontend()
{
Pageview = pageView,
Paragraph = paragraph
};
var moduleOutputResult = cm.GetContentBySettings(args.ToString());
if(moduleOutputResult is OutputResult and ContentOutputResult contentOutputResult)
return contentOutputResult.Content;
return string.Empty;
}