Version:

How do I get custom code onto my page/template?

If you want to add custom code to your website you can use Field formatters, Blocks and Custom Site Studio elements.

Field Formatters

Field data from content entities can be rendered on a Site Studio template either as raw data via tokens, or using the field’s default Field Formatter. If using a Field Formatter, the output will be exactly as defined by the field module. This means Site Studio will work seamlessly with core fields and contributed modules that supply their own layout and templates for their field output. Developers are also able to create custom fields with custom formatters and Site Studio will render these exactly as the developer has defined.

Blocks

The simplest way to inject developer created layout and styling into the Site Studio templates is to define them as a standard Drupal block. With that approach you can create any layout you need, bring in blocks defined in drupal.org modules and retain 100% control of the layout of that block.

Custom Site Studio elements

The downside of using a block is there is no way to give a site builder options from within the Site Studio sidebar editor. To do this, you can create your own Site Studio element and define its form using the Plugin API.

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.