How to make all header and footer sections non-editable? #4063
-
Hello all, I am using the grape js page builder and want to configure all the header and footer sections that I have designed to be non-editable for users. Also, I want to restrict users to having only one section of header and footer be present on the page, they should only be able to remove and replace these two sections. Please let me know how can I achieve this. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hi @rcnetclues. If you have built the header and footer sections as components, then in the model you can set To allow only one header and one footer, you can set use a key-map. On addition of header set the header key to true, on removal make it false. Check the key every time,when adding the header or footer. If the key for that element is true, execute your code(like popover message etc.) . Do check the API reference for the editor and the component. It will give you more insights in solving your problem. |
Beta Was this translation helpful? Give feedback.
-
This is a good start https://jsfiddle.net/artur_arseniev/w6mvq4bx/ |
Beta Was this translation helpful? Give feedback.
-
I was working on the same thing and came up with this solution: Try selecting a partial element and then going into the component traits tab. |
Beta Was this translation helpful? Give feedback.
-
Thank you for replying to this. I achieved it by adding the following to each and every HTML tag of the section: data-gjs-highlightable="false" Please note I had to upgrade to the latest grapes js version. |
Beta Was this translation helpful? Give feedback.
@Vac1911
Thank you for replying to this. I achieved it by adding the following to each and every HTML tag of the section:
data-gjs-highlightable="false"
data-gjs-draggable="false"
data-gjs-editable="false"
data-gjs-copyable="false"
data-gjs-resizable="false"
data-gjs-layerable="false"
data-gjs-selectable="false"
data-gjs-hoverable="false"
data-gjs-stylable="false"
Please note I had to upgrade to the latest grapes js version.