PageConfiguration.HeaderActions.AddLink

2025/03/04 5:13 PM

For the listing page of the Web Channel Snippets, the PageConfiguration.HeaderActions.AddLink and PageConfiguration.AddEditRowAction are [Obsolete] in 30.0.1 and 30.2.0 which result in scan vulnerabilities. The deprecated suggestion is "Use AddLink with PageParameterValues instead".

    PageConfiguration.HeaderActions.AddLink<WebChannelSnippetCreatePage>(
        label: stringLocalizer["New snippet"],
        parameters: WebChannelSettingsId.ToString());

Here is the closest configuration that isn't giving the deprecated warning. However, running this results in an error: Parameter for the page type '<Namespace>.Pages.WebChannelSettings.WebChannelSettingsEditSection' is missing. I've reviewed the github training-guides repository also, but the version is still 29.6.1.

        PageConfiguration.HeaderActions.AddLink<WebChannelSnippetCreatePage>(
            label: stringLocalizer["New snippet"],
            icon: Icons.Plus,
            parameters: new PageParameterValues
            {
                { typeof(WebChannelSnippetEditSection), WebChannelSettingsId }
            });

When running the [Obsolete] code, the application returns the same error even though the record has been created: Message: Parameter for the page type 'GL.Kentico.Admin.Pages.WebChannelSettings.WebChannelSettingsEditSection' is missing.

Additionally, in the ConfigurePage of the Create Page, AdditionalUrlParameters.Add is now AdditionalLinkParameters.Add

// Obsolete
AdditionalUrlParameters.Add(WebChannelSettingsId.ToString());

// Appears to be working as intended
AdditionalLinkParameters.Add(
  new PageParameterValues
  {
    { typeof(WebChannelSnippetCreatePage), WebChannelSettingsId }
  });

Any suggestions?

Environment

Answers

2025/03/05 5:29 PM
Answer

Take a look at the UI Tree in the System application. It will show you which parameters are required to generate URLs for every built-in administration page in Xperience.

Here's an example for a Content hub item's Content tab:

// URL parameters sample (usings are ommited for clarity):
new PageParameterValues()
{
  { typeof(ContentItemEditSection), /*<REPLACE_WITH_ACTUAL_VALUE>*/ },
  { typeof(ContentHubFolder), /*<REPLACE_WITH_ACTUAL_VALUE>*/ },
  { typeof(ContentHubContentLanguage), /*<REPLACE_WITH_ACTUAL_VALUE>*/ },
  { typeof(ContentHubWorkspace), /*<REPLACE_WITH_ACTUAL_VALUE>*/ },
}

// URL path within administration:
// /content-hub/{ContentHubWorkspace}/{ContentHubContentLanguage}/{ContentHubFolder}/list/{ContentItemEditSection}/content

Here's an example from the Kentico Community Portal source which links to a custom application page.

_ = PageConfiguration.HeaderActions
  .AddLink<MemberBadgeAssignmentEditPage>(
    "Manage assigned badges", 
    Icons.Edit, 
    parameters: new PageParameterValues
    {
       { typeof(MemberBadgeAssignSectionPage), ObjectId }
    });

To answer this question, you have to login first.