Editing the Admin Edit Page Styles
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
Xperience by Kentico version: [30.3.1]
.NET version: [8]
Execution environment: []
Link to relevant Xperience by Kentico documentation
Answers
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.