Using Viper Editor in an Asset Builder


(gja) #1

**Matrix Version:**5.4.51

Hi,

Is there any documentation to assist in getting up and running with using viper in an asset builder?

I’ve downloaded the files from https://github.com/squizlabs/Viper but am having trouble getting it to work.

I’m getting lots of errors about missing css files, but they aren’t in the repo so that can’t be the problem.

Thanks Georgina.


(Chiranjivi Upreti) #2

Viper is bundled with Edit+. You will need to get the correct version of Edit+ tarball matching your Matrix version, and then extract it into data/public dir as per Edit+ installation guide: https://matrix.squiz.net/resources/installation-guides/edit-plus-installation-guide

Once the Edit+ and Viper file are available in data/public/ees dir, you can update the WYSIWYG Content Type Preference in Global Preferences to use Edit+ editor for Matrix admin mode.

Note that this is a system wide setting and will apply to all the places using WYSIWYG Content Type not just for Asset Builder’s bodycopy.


(gja) #3

This isn’t what I want to do.

We already have edit+ installed and are using it both for _edit and _admin.

I want to use viper as the editor in asset builder on a wysiwyg metadata field.

I want to setup viper as per the MultiViper example on https://github.com/squizlabs/Viper.


(Chiranjivi Upreti) #4

Ah gotcha! Unfortunately Viper is not supported there (along with couple few of places):
https://squizmap.squiz.net/matrix/9295

Is there any documentation to assist in getting up and running with using viper in an asset builder?

This is something that will need to be supported in the Matrix natively. The Viper files are already there in your Matrix instance, its just that currently they don’t work in frontend output due some of lib files required for Viper does not gets loaded in the frontend by Matrix.


(gja) #5

I have seen it work elsewhere, on WYSIWYG fields in an asset builder.

The existing out of the box solution is clunky and really isn’t user-friendly at all.


(Nick Papadatos) #6

Agreed, I’m currently trying to build a central news hub so we can push stories across different areas of our website but am disappointed with the WYSIWIG editor within an asset builder as well. Apparently Viper can be embedded (you’ll have to get squiz to do it for you and depends on what version of Matrix you’e on) but me thinks we’re being forced to use Edit+?


(gja) #7

I don’t see why we should have to get squiz to do it for us, every time we want to create a new asset builder.


(Bart Banda) #8

You should be able to get it working by using the standalone version of Viper if you are downloading and using it from GitHub, or you can just link to the same CSS and JS files that are used in Edit+.

Have a look at the example implementation in that GitHub repo as well for how to run it standalone: https://github.com/squizlabs/Viper/tree/master/Examples/Modern

To use it on an Asset Builder that is already using the classic WYSIWYG, you might have to do some trickery where you manually output the hidden field that normally would get printed using a keyword, and then initiate Viper manually against it.

We are planning on making this easier once we deprecate the classic WYSIWYG and bring Viper into core for Matrix which is scheduled for later this year, but you should be able to work around it with some manual minor frontend dev.

Let me know how you go.