8 . Container Lock

It’s usual to have JavaScript code that modifies certain parts of the HTML on the page. In this scenario it’s good to lock the container to prevent bad side effects. When the container is locked its initial HTML layout is always preserved in the database, so when the page reloads the container will be rendered with its initial state.

To lock the container press the lock button on the container's toolbar.

Use Cases

If you don’t lock a container before JS operates over it, it’s certain you will end-up with bad side effects when you make a next manual modification to layout afterwards. 

Example 1

new Vue({
  template: '<section>APP</section>',
  el: '#app'  
})

When JS is executed Vue app will ‘overtake’ a control over div#app and will entirely replace it with <section>APP</section>

If we modify the layout manually afterwards, we will entirely lose div#app. After the page is reloaded we will notice that div#app has disappeared. To avoid this behavior lock the container and then let JS modify it.

Example 2

JS modified the inner HTML of the container, and it was saved into database.

document.querySelector(“#app”).innerHTML = “<ul><li>1</li><li>2</li><li>3</li></ul>”

<div id="”app”"></div>

If we modify the layout after JS execution, our div may end up saved with all the inner HTML, so on next page loading we will not have empty div#app. To avoid this effect, we should lock the container.

It is not possible to remove the locked container. 

To be able to remove the container you should unlock it.

DIMS content can be modified inside locked containers

DIMS content is allowed to be modified for elements that are under a locked containers. In the following example <div> is locked, but paragraph content still can be edited. 

<div><p>I can edit the text of this paragraph</p></div>


  1. Core Concepts
    1. Structured Data, MicroData, Schema.org
    2. GraphDB & Dynamic Content
    3. Html Renders (VPTL Model)
    4. Semantic HTML  (Document Semantics)
    5. CSS & Preprocessors
    6. External CSS & JS Libraries
    7. Integrated CMS
    8. Momentum Network and Market
  2. Environment
    1. Viewport
    2. Project Settings
    3. Tools Panel
    4. Code Editor & External Libraries
    5. Visual Helpers
    6. Web Parser
    7. Structure Panel
    8. Render Panel
    9. Stylebook
    10. Assets
  3. HTML
    1. Layout Structure (Master Template)
    2. Basic HTML Building
    3. Parsing Pre-made HTML
    4. Working With Snippets
    5. HTML In Dynamic Collection
    6. Hidden HTML Elements
    7. Forms
    8. Container Lock
  4. Website Structure
    1. Blank Pages
    2. Schema.org Classes
    3. Collections
    4. Collection Properties
    5. DIMS Module Settings
    6. Stylebook (vptli)
    7. Using Render Panel
    8. Index Operations
    9. Relations Between Collections
    10. Taxonomies
  5. Schema.org, Advanced
    1. Independent vs Context
    2. Testing Schema
    3. Knowing When To Stop
  6. Classes & Attributes, Advanced
    1. Auto Generated Classes
    2. Dynamic Attributes
  7. DIMS (CMS)
    1. Overview
    2. DIMS Interfaces
    3. DIMS Modules
    4. Publishing Content
  8. Building Editing Flow
    1. Inbound & Outbound Relations
    2. Using Dims Attributes
  9. Going Live
    1. Connect An External Domain Name