Reusable components library (Pro)

About the feature

Reusing is a fundamental aspect that enables developers to create advanced functionalities without investing excessive time in implementation.

In the Pro version, you can reuse Layouts and Post Selections that you've crafted for one website and use them on multiple other websites. You have the capability to preserve any item in your personal Git library, expediting the development process for future websites.

How it works

Reusing necessitates an independent storage space (library) distinct from any specific project, along with a way of pulling and pushing items to this library.

Within Advanced Views, any GitLab repository can function as a component library, and the Advanced Views UI facilitates pulling and pushing Layouts and Post Selections into this library.

Additionally, you have the option to include related Meta groups with the component, prompting Advanced Views to automatically create all associated Meta groups during the pull process.

We've opted for Git due to its robustness and widespread use as a version control tool, with GitLab repositories being entirely free.

You can interact with the library solely through the plugin's UI or alternatively, make modifications using the git terminal and GitLab UI.

The libraries you construct are entirely yours, ensuring you maintain full control over them even after your Pro plugin license may have expired.

Note: The Git library is project-independent, allowing you to continue using Git for managing specific projects, as Advanced Views refrains from creating any '.git' folder and utilizes Rest API for pulling and pushing items to the library.

How to create a Git 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.

How to add (push) items

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'.

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.

How to import (pull) items

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.

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.

Overriding existing items

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

Last updated