Magic Preview 1.7
Magic Preview 1.7 is out and contains some compelling new features. Install via the modmore package provider.
Share your drafts
There's a new Share button in the draft panel that allows you to create secure token-based share links to your preview. Each link uses a long random token, and only the token's hash is stored in the database. Paste a share link into an email or a chat with a client, and they can instantly see your work in progress without needing manager access or a password. Create more than one share for each draft with each having it's own expiry time and label. Need to revoke access for one shared preview link but not others? Then you can revoke a single share link with the click of a button. The other links stay active (until their expiry time).
Drafts get a proper home
Drafts were introduced in 1.6, stored in the MODX cache. That worked, but the cache is meant to be disposable; clearing it could take your drafts with it. In 1.7, drafts move into their own database table, so they stick around until you discard them. Any drafts you saved with 1.6 are migrated over automatically the first time they're loaded.
Collapsible resource sidebar in MODX 3
The most exciting feature in 1.6 was the on-page preview in the resource edit page, so you could see your changes update in real time on the same page you're editing. MODX 3 includes an extra column on the right side of the resource edit form that keeps common options visible, but with a preview on page it does shrink the usable editing space. In Magic Preview 1.7, when you open an on-page preview, that resource page side bar will collapse down to the bottom of the page to give you more editing space. The same as what would happen if you have a narrow screen/viewport.
Click to field (Experimental)
When using ContentBlocks to edit a resource, in the preview, click on paragraph of text and the resource edit form will automatically scroll to that textarea field to edit. Click on an image in the preview, and it'll scroll to the image field to edit. This also works with core resource fields such as pagetitle, or longtitle. It even works with Template Variables and will automatically switch to the TV tab. Please note this is an experimental feature, and it needs to be enabled via the magicpreview.click_to_field system setting. Also, if you wish to use it with ContentBlocks, be sure to check the ContentBlocks_After_Parse event is enabled on the MagicPreview plugin.
Enable/Disable previews by template id
Set the system setting magicpreview.template_filter_mode to Block listed or Allow listed only in the dropdown and then add a comma-separated list of template ids to magicpreview.template_filter_ids to enable/disable Magic Preview functionality on resources using those templates. You can now also enable/disable previews directly on the resource under the Settings tab. You'll need to refresh the page after saving to see the change.
And more...
There have been other tweaks and layout improvements. There's now a View button in the draft panel that lets you see the preview of the saved draft directly in a new window. There was a bug in how the draft panel was previously rendered that only came to light when working on the "click to field" feature. The panel has now been moved to the very top of the viewport in MODX 3 allowing correct column heights when auto-scrolling. If you've added any custom templating based on the old version, you'll need to update that.
We've recently disabled comments as we don't care for Disqus's ads and don't use it enough to warrant a subscription. We may implement another commenting system soon. If you have any questions or comments, please feel free to send us an email! We're always excited to hear from you.