---
title: "admSetSpaceLayout"
canonical: "https://support.appfire.com/space/PSCONF/15303877/admSetSpaceLayout"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | admSetSpaceLayout(spaceKey, layout) | **Package** |  |
> | **Alias** | admSetSpaceLayout(decorator) | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Creates a decorator for the given spaceKey with the given name, and saves it.

Creates a decorator for the given spaceKey with the given name, and saves it. Will update an already existing decorator with the same (spaceKey, name) pair. Also updates the velocity cache.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | spaceKey | String | Yes | The key of the Confluence space to which the syle should be applied. |
> | layout | String | Yes | A String representing the css styles for the space |

### Or

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | decorator | **[CLayout](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15303915)** | Yes | Predefined structure that defines the new Layout |

## Return Type

**Boolean (true/false)**

Returns true if the layout was successfully applied

## Examples

### Example 1

```javascript
return admSetSpaceLayout("MS", "layout");
```

### Example 2

```javascript
CLayout layout;
layout.spaceKey = "MS";
layout.body = "hello";
admSetSpaceLayout("someSpaceKey", layout);
```

## See also

> Macro (contentbylabel)