Server-Side Code in Layout Builder Tiles
You can use server-side code in Layout Builder to publish directly to your production server. Layout Builder supports all server-side languages, including PHP, ASP, CFM, and JSP.
Add server-side code to both global and editable (WYSIWYG) tiles. When used in a WYSIWYG tile, the server-side code itself is not editable on the page (Layout Control File [LCF]) but can be deleted from the page.
- When you create or edit a tile, in the Source editor, click Insert Server-Side Code.
- Enter code.
- Select the preview type.
- Image: Use the file chooser to select an Modern Campus CMS file controlled by dependency manager or paste an external URL.
- Inserts a full-width image.
- File: Use the file chooser to select an Modern Campus CMS file controlled by dependency manager or paste an external URL.
- Image: Use the file chooser to select an Modern Campus CMS file controlled by dependency manager or paste an external URL.
- Click Save.
Your code appears as an editable pill in the HTML source editor. To see how the tile will look when published, go to the page actions toolbar, click Preview. Server-side code tiles will also preview in layouts and LCF pages.
Then, add your tile to layouts to create LCF pages. If you have edited and re-launched a tile, update the layout(s) that use the tile. Edits will appear automatically in pages on the staging server that use the tile.
Add an include fileLink to this section
Use server-side code in a global tile to add and preview your include files, like headers, footers, and navigation. For example,