> For the complete documentation index, see [llms.txt](https://wplake.gitbook.io/advanced-views/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wplake.gitbook.io/advanced-views/features/workflow/cross-installation-components.md).

# How to create cross-installation components

Reusability is a core principle that helps us build advanced functionality without spending a long time on implementation.

With Advanced Views, you can reuse [*Layouts*](/advanced-views/getting-started/first-layout.md) and [*Post Selections*](/advanced-views/getting-started/first-post-selection.md) created for one website across any number of other websites.

Save any item to your personal library and reuse it in future projects to accelerate development and maintain consistency.

#### Component export vs. Cross-installation components

Both features support exporting and importing components, but they serve different purposes.

1. [Component export](/advanced-views/features/workflow/components-export.md) is the simplest option for creating backups or performing a one-time migration of components between installations.
2. **Cross-Installation components** are designed for long-term reuse across multiple installations. They let you maintain standalone, reusable components, which include related Meta Group&#x73;**.**

## 1. About git-based storage

Reusing components requires a storage location that is independent of any specific project, along with a way to push components to and pull them from that library.

In Advanced Views, any GitLab repository can serve as a component library. The plugin provides a built-in UI for pushing *Layouts* and *Post Selections* to the library and pulling them into other projects.

{% hint style="success" %}
You can also include related Meta Groups with a component. When the component is pulled into a project, Advanced Views automatically creates all associated Meta Groups.
{% endhint %}

We chose Git because it is a robust, widely adopted version control system, and GitLab offers free repositories that are ideal for this purpose.

You can manage your library entirely through the plugin's UI or, if you prefer, work with it directly using Git and the GitLab web interface.

Your component libraries are private and fully under your control, giving you complete ownership of your reusable assets.

{% hint style="info" %}
**Note:** The Git library is independent of your projects, so you can continue using Git to manage each project as usual. Advanced Views does not create a `.git` directory or interfere with your existing repositories. Instead, it uses the GitLab REST API to push components to and pull them from your library.
{% endhint %}

## 2. How to create a cross-installation library

1. Create a GitLab account (free).
2. Establish a new private repository (free).
3. Navigate to the 'Git repositories' tab in the plugin settings and follow the provided instructions to add the new repository.

## 3. How to add (push) items to a library

Once you've added a Git repository in the settings, you can 'push' any *Layout* or *Post Selection* to the repository. Simply edit the *Layout* or *Post Selection*, select the repository from the 'GitLab repositories' box (located in the right panel), and click 'Push'.

If you select the 'Include related Meta groups' checkbox, the component will also store data of the associated Meta Groups (such as ACF Group) and automatically import them during 'pulling'.

{% hint style="info" %}
Note: When you 'push' a *Layout* or *Post Selection*, all related *Layouts* will be included automatically. Therefore, pushing a *Post Selection* will also push the corresponding *Layout*.
{% endhint %}

## 4. How to import (pull) items from a library

Once you've added a Git repository in the settings, you can 'pull' any *Layout* or *Post Selection* from the repository to the current website.&#x20;

In the items list table header (*Layouts* or *Post Selections*), you'll notice a new tab named after your repository. Click on it to see the list of available items. You can then 'import' individual items or perform bulk imports.

{% hint style="warning" %}
Please be aware that importing may take some time, especially if components include Meta Groups data. Therefore, we recommend importing no more than 5 items at a time.
{% endhint %}

#### Overriding existing items

If you import items that already exist on the website, then they will be overridden instead of creating duplicate entries.
