liam@goldfinch ~/blog · main
Back to posts · ~/blog/posts/enable-quick-page-editing-from-your-xperience-by-kentico-website-channels.md

Enable Quick Page Editing from Your Xperience by Kentico Website Channels

I built an open-source package that brings the old "Edit Page" button back to Xperience by Kentico website channels. It authenticates admin users on the front end via HttpContext.AuthenticateAsync with the admin application scheme, then renders a ViewComponent linking straight to the page builder.

If you’ve worked with earlier versions of Kentico using Portal Engine and ASP.NET Web Forms, you might remember the handy "Edit Page" button that appeared on the website’s front-end for authenticated content editors.

Does that sound familiar? 🤔

I’d actually forgotten about it 😂 until one of our Xperience by Kentico clients asked if it was possible to enable this feature. Given their experience with it on their previous site, it was a natural request to see if it could be integrated into Xperience by Kentico.

I thought it was a brilliant idea to develop an open-source package that reintroduces the "Edit Page" button functionality in Xperience by Kentico. My main challenge was figuring out how to determine if a website visitor was authenticated in the administration portal. Unlike earlier versions of Kentico, where front-end users and administration users were the same, Xperience by Kentico differentiates between administration users and front-end members. This change added a layer of complexity, making the implementation of this feature both intriguing and valuable.

The approach

Before diving into development, I wanted to explore the best method for checking if a website visitor was authenticated in the admin site. After discussing various ideas in the community portal, I found that using HttpContext.AuthenticateAsync was the most effective approach. This method allows you to verify if a user is authenticated under a specific authentication scheme. For instance, you might have a specific scheme set up for your front-end visitors if it has an account area with gated content. To make sure that this new package was using the right scheme, I used the following constant, AdminIdentityConstants.APPLICATION_SCHEME.

Once I resolved the authentication check, I proceeded to create a ViewComponent to manage the rendering of the "Edit Page" button. This component not only handles the display of the button but also dynamically generates the correct admin page URL based on the current page being viewed on the front-end. This setup ensures that content editors can easily navigate to the appropriate administration page for quick editing. ⚡

I recommend checking out the GitHub repository for detailed instructions on setting up the package in your project. You'll find comprehensive guidelines as well as the source code for the ViewComponent that handles the button rendering and URL generation. 👀 Explore the repository to get a closer look at how it all works!

// related

Keep reading

how-i-used-claude-code-to-redesign-my-kentico-sustainability-module.md 2 min
#post

How I Used Claude Code to Redesign My Kentico Sustainability Module

Discover how I used Claude Code, Anthropic’s AI coding assistant, to refactor and redesign the UI of my Kentico Sustainability module - replacing third-party components with native ones and creating a cleaner, more integrated experience.

#Kentico #AI tooling #Open source
goldfinch-me-is-now-open-source.md 3 min
#post

Goldfinch.me is Now Open Source

Learn about why I’ve made the source code for my personal blog site publicly available on GitHub.

#Kentico #Open source
bringing-sustainability-insights-to-xperience-by-kentico.md 3 min
#post

Bringing Sustainability Insights to Xperience by Kentico

Open source meets sustainability: the XperienceCommunity.Sustainability package brings green tooling to Xperience by Kentico - inspired by Umbraco, and already giving back to it.

#Kentico #Umbraco #Open source
boost-site-speed-using-image-processing-for-xperience-by-kentico.md 2 min
#post

Boost Site Speed Using Image Processing for Xperience by Kentico

Discover how the XperienceCommunity.ImageProcessing package can significantly enhance your website's performance in Xperience by Kentico. This integration allows for resizing images and converting them to modern formats like WebP, resulting in faster page loads and improved user experience.

#Kentico #Open source