Version:

    Element toggle settings

    In version 8.0.0 Site Studio has introduced a new feature that allows users with the correct permission to toggle Site Studio default elements on and off, that are not in use on the site. This feature is ideal when starting a website build and "out-of-the-box" elements are not required, however, it can be used at any point where an element is not being used on the site.

    By default new and existing Site Studio installs, all default elements are enabled, and can only be disabled once the element usage report has been generated. The element usage can be run via cron or batch in the UI. There is also a drush command sitestudio:element-usage which generates the element usage data.

    Configuring element toggle

    The element usage report  is NOT generated automatically and should be run before disabling elements. The last time the element usage report was run is displayed at the top of the page.

    Elements can be toggled by navigating to Site Studio > Configuration > Element settings > Element toggle settings in the UI. 

    Generate element usage using batch

    Click the “Generate in use via batch” button, to generate all the elements usage using batch.

    A process bar will appear and once the element usage has been generated, the user is presented with a table of the default elements showing if and where they are used. If an element is in use it can not be disabled.

    If an element is not in use, a user can disable it by unchecking the enable checkbox and clicking “Save settings” and that element will no longer be able to be used on the layout canvas on the site.

    Generate element usage using cron

    Click the “Generate in use via cron” button, to generate all the elements usage using cron.

    Once cron has run and the element usage has been built, the user is presented with a table of the default elements showing if and where they are used. If an element is in use it can not be disabled.

    If an element is not in use, a user can disable it by unchecking the enable checkbox and clicking “Save settings” and that element will no longer be able to be used on the layout canvas on the site.

    Generate element usage using drush

    The element usage can also be generated using the drush command sitestudio:element-usage - this will use drush batch to generate the element usage report. 

    If a user attempts to import a Site Studio package where a disabled element is used, the import process will fail with an error like so: "The slider container element is used within this package, but it is currently disabled on this site. See element toggle settings."

    DX8 knowledge base icon

    Frequently asked questions

    Get instant answers to common questions. Available online 24/7.

    Find answers

    Raise a ticket icon

    Raise a support ticket

    To raise a ticket, sign into Acquia Cloud and select Help in the top menu.

    Raise support ticket

    Acquia

    Copyright © 2020 Acquia, Inc. All Rights Reserved. Drupal is a registered trademark of Dries Buytaert.