How to edit styles inside Kentico 12SP MVC page builder?

Oaks Oaks asked on February 8, 2021 09:55

I have a site running Kentico 12SP MVC. For reasons, I won't get into, my Header and Footer have a z-index in the millions. Unfortunately, the z-index is so high that it blocks the pagebuilder features in Kentico. How can I add CSS/JS to detect whether I am inside the page builder and adjust the z-index accordingly?

Recent Answers


David te Kloese answered on February 8, 2021 10:43

Hi,

Easiest thing to do would probably be to add a specific class when you are the CMS. You can do so

By checking if the current request PageBuilder in edit mode by:

HttpContext
.Kentico()
.PageBuilder()
.EditMode;

Have a look at this blog from MVP Sean where he explains more details: dev.to/...determining-a-request-s-page-builder-mode

You still have to adjust your css based on that class.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.