Editing the Admin Edit Page Styles

2025/05/16 7:19 PM

Is there any way to add some additional, custom CSS to the CMS administration pagebuilder tab that would apply to pages in edit mode?


Environment

Answers

2025/05/16 8:10 PM
Answer

Of course!

You can use the PageBuilder mode information to conditionally render anything into a view at any level (_Layout.cshtml, page template, section, widget, etc...).

There's an example in the Kentico Community Portal which gets this information from the HttpContext and also some information about this in the docs which uses the IPageBuilderDataContextRetriever.

I would recommend putting this information inside an abstraction vs injecting the context retriever into every view using @inject view DI with Razor.

Years ago I made an ASP.NET Core Tag Helper to conditionally render content on a page based on the Page Builder mode. It was built for KX13 but it could easily be re-created for XbyK.

To answer this question, you have to login first.