Assets management

Visual Composer elements have an ability to include JS and CSS libraries out of the box. These libraries are called shared assets.

Assets are included to an element via the settings.json file. But it will only enqueue an asset if it is already available within a Visual Composer plugin. For instance, some other elements may contain assets, like Icon element. The Icon element contains multiple various icon libraries or assets, but these assets are available within a plugin only if the Icon element is downloaded.

A fresh installation of Visual Composer plugin comes only with a few basic elements, so some of the assets can only be available once particular elements are downloaded.

The manifest.json file allows to specify a particular asset and it will a download it without downloading an element.

Include assets via settings.json

To include an asset inside settings.json file a sharedAssetsLibrary meta attribute should be used.

The dependencies property may store a particular asset or an element. Which means that if an element is specified as a dependency, this element will be downloaded along with all of its assets. Whereas the specified asset will download this particular asset.

In the example above there are two items listed under the dependency property. One is the asset and another is an element.

To download only a single asset “asset/assetName” value has to be specified.

To download only an element “element/elementName” value has to be specified.

We use cookies to provide a personalised experience for our users. By continuing to browse this site, you give consent for cookies to be used. For more details, please read our Privacy Policy and GDPR section.