Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with Lingua #12

Closed
clutchmarketing opened this issue Apr 6, 2020 · 1 comment
Closed

Doesn't work with Lingua #12

clutchmarketing opened this issue Apr 6, 2020 · 1 comment

Comments

@clutchmarketing
Copy link

When the multi-lingual plugin Lingua is installed, Magic Preview doesn't provide a preview of the template variables in any of the languages.

@muzzwood
Copy link
Contributor

muzzwood commented Sep 23, 2021

Hi @clutchmarketing
The next release of MagicPreview will include the event OnResourceMagicPreview which will allow other extras to hook in to the preview action and parse the output needed.

To make Lingua compatible, the maintainer/contributor can use a plugin like this:

<?php

switch ($modx->event->name) {
    case 'OnResourceMagicPreview':
   
    /** @var modResource $resource */
    $resource->setContent() etc.
    // Parse resource here to include all values before displaying preview

    break;
}

The variable $resource is the resource that is being previewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants