Simple:Press Documentation

Plugin: Post Preview

Plugin Description

This Simple:Press plugin adds a Post “Preview” button option to the editor which allows a post author to preview the current content of a post when developing a new topic post or editing a in-progress topic post before submitting it. The post can be either a New Topic post or a Topic Reply post.

All members of the forum who are able to create topics or reply to topics will also be able to use the post preview.

Plugin Features

Installing the Simple:Press Post Preview plugin adds:

  • A new “Post Preview” section in the Plugin Management panel under the Admin menu path Forum – Plugins – Available Plugins. From this panel the plugin can be activated, or deleted by the admin.
  • When properly installed, a new folder in the “forum-plugin” folder named “post-preview” containing the plugin’s files.

Activating this plugin provides:

  • A change to the new “Post Preview” section in the Plugin Management panel under the Admin menu path Forum > Plugins > Available Plugins so the plugin can be deactivated, or uninstalled.
    • There are no options for this plugin.
    • The “Getting Started” link associated with the “Deactivate/Uninstall” selections should be selected to view the pertinent information regarding the plugin.
  • In the New Topic post and Reply to Topic post forms the plugin creates a new “Preview” button visible to users with the necessary permissions next to the ‘Cancel” and “Submit Topic” or “Submit Reply” buttons at the bottom of the form.
  • In the New Topic post and Reply to Topic post forms just below the edit window (text input window) a window opens showing what the post will look like once submitted when the “Preview” button is clicked upon.

There are no new permissions added to the permission sets due to this plugin, however a user must have at least one of the following “Creating” permissions to use the “Post Preview” plugin capability:

  • “Can start new topics in a forum” to have access to the “Preview” button while developing a new topic.
  • “Can reply to existing topics in the a forum” to have access to the “Preview” button while developing a topic reply post.

Plugin Requirements

Simple:Press version 5.5.8 and above is required.

The plugin must be installed, and activated before it is operational.

As part of the installation, a “Post Preview” section is added to the Plugin Management panel under the admin menu Forum > Plugins > Available Plugins. From this panel the plugin can be activated, deactivated, uninstalled, or deleted.

  • There are no options that need be set up for this plugin.

There are no new permissions added to the permission sets due to this plugin, however a user must have at least one of the following “Creating” permissions to use the “Post Preview” plugin capability:

  • “Can start new topics in a forum” to have access to the “Preview” button while developing a new topic.
  • “Can reply to existing topics in the a forum” to have access to the “Preview” button while developing a topic reply post.

The plugin does not have template tags so no recommendation regarding Custom or Child Themes is being made.

Plugin Installation and Activation

Please see Using Plugins on how to obtain and install this Simple:Press plugin.

  • Whatever method is used to add the Simple:Press plugin, the folder that should have been added to the forum plugin folder is named “post-preview“.
  • If using the “Simple:Press Upload Plugin – Upload a Simple:Press Plugin” panel at the forum Admin menu Forum > Plugins > Plugin Uploader, the folder to browse for after downloading it from the Simple:Press site is “post-preview.zip” before clicking the “Upload Now” button.

As mentioned there the default location for Simple:Press plugin folders is …/wp-content/sp-resources/forum-plugins. If this path is changed, it is important to note that the plugin’s folder and its content need to reside in the forum plugins folder wherever it has been moved and however it has been renamed. See Storage Locations for more information.

Activation is accomplished from the Admin Dashboard panel menu by selecting “Forum” and then “Plugins” from the drop down Forum Admin menu. On the Simple:Press Administration panel select the “Post Preview” plugin on the “Plugin Management” panel and click on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall”.

To deactivate the plugin, click on “Deactivate”. The “Deactivate/Uninstall” label changes to “Activate/Delete”. Activating the plugin again reinstates plugin functionality.

Plugin Administrative Options

After installing and activating, there are no necessary plugin admin options to be set.

Plugin Language Translation

A plugin may not have language translation files, but in general each Simple:Press plugin has its own language translation files each with multiple pages for translating the forum plugin’s message strings.

Forum Plugin translation files are to reside in a unique forum folder location as defined by the “Simple:Press Plugin Language Files” entry on the “Integration – Storage Locations” forum Admin panel available through the forum Admin menu at Forum > Integration > Storage Locations.

  • The default location for forum plugin translation files is the folder “…/wp-content/sp-resources/forum-language/sp-plugins”.

Information regarding downloading language files, “mo’ language file placement, and translation (language localization) is found at Localization.

WARNING: On the Localization page, the Language Translation “.mo” Files Overview should be reviewed and well understood for naming convention and language translation file placement.

More information is available regarding translation files at Simple:Press Translations. which is the repository for Simple:Press language translation files. On the base page, select the “Getting Started Guide” link for basics about it’s use. On that page, select the “register a username here” link to obtain a password to the site. Use the “Contact Form” link to request the desired language if it is not currently available. The “Contact Form” link may also be used to volunteer to be a validator for a translation project.

This plugin’s available language translation files with translation statistics, and message translations can be viewed at Post Preview within the repository for Simple:Press language translation files.

  • Installing this Simple:Press Plugin’s Language Translation “.mo” files
    The plugin’s language translations files for each language can be correctly located in two ways.

    • Using the Admin Word:Press “Site Language” and Simple:Press “Language Translation” Features
      WARNING: On the Localization codex page, the Language Translation “.mo” Files Overview should be reviewed and well understood for naming convention and language translation file placement.
        • Under the “Language Translation Selection Sequences” heading, the “Coordinated Language Translation File Download Using the Simple:Press ‘Language Translation’ Selection” section, follow the instructions at “Adding its Translation File(s) After Downloading/Activating a Simple:Press Theme or Simple:Press Plugin”.
          • Follow the instructions to select the “Site Language” and then get to the admin page with the “Integration – Language Translations” section where there should be an entry for “Post Preview” along with an “Install” button.
          • Click on the “Install” button for this plugin to install the language translation file for the current “Site Language” language.
            • Note: If the message “No Translation Project Exists” is displayed rather than the “Install” button, a translation file for that language could not be found in GlotPress at this time. Consider posting in the Simple:Press forum if it is felt there needs to be one added.
          • Be sure to verify the locale (filename) for the “.mo” file matches the language code for the language as referenced in the “Warning” above. If it does not, change it to match.
          • As called out in the section, continue to change the “Site Language” language and repeat the process until all desired translation files for this plugin have been installed.

       

    • Manually Finding and Storing Simple:Press Plugin’s Language Translation ‘mo’ files
    • WARNING: On the Localization codex page, the Language Translation “.mo” Files Overview should be reviewed and well understood for naming convention and language translation file placement.
    • After reviewing the material discussed under the “Language Translation Selection Sequences” heading, the “Manual Installation of Simple:Press Language Translation Files section, follow the steps outlined at “Finding and Storing ANY Simple:Press Plugin’s Language Translation ‘mo’ files”.
    • Each time through the process at the step, “Scroll down the list and click on the name of the plugin whose language files are being sought to see the translation file Version Number available”, substitute “Post Preview” for the phrase “the name of the plugin whose language files are being sought”.
    • Be sure to verify the locale (filename) for the “.mo” file matches the language code for the language as referenced in the “Warning” above. If it does not, change it to match.
    • Repeat the steps for each language it is desired to have a translation file (french, spanish, etc.) for the plugin on the website.

Plugin Usage

Forum users with the proper post “Creating” permissions can select to preview the current content of a post during the development of the post.

  • Previewing The Post
    • After clicking on the “Add Topic” or “Add Reply” button to display the “Add Topic” or “Add Reply” post form and inputting text for the post, scroll down past the “Options” section of the form to view the “Preview” button next to the “Cancel” and “Submit Topic” or “Submit Reply” buttons.
    • Click on the “Preview” button to cause just below the edit window (text input window) a new window to open showing what the post will look like if it were submitted now.
    • Go back and click within the edit window (text input window) to continue inputting or editing the post content.
    • Click on the “Preview” button again to see the results of the completed edits.
    • Repeat the “edit” & “Preview” sequence as many times as desired until the post has been completed.
    • Click on the “Submit Topic” or “Submit Reply” button to submit the completed post.

Plugin Special Notes

None

Template Tags Used in the Plugin

There are no Template Tags used in this plugin.

Actions and Hooks Used in the Plugin

There are no Actions and Hooks available in Template Tags for this plugin.

There are other Actions and Hooks available for this plugin

Used in file ‘sp-ahah-preview.php’

  • do_action(‘sph_preview_end’) – Hook fired after the post preview window has been displayed.

Plugin and Template Tag Changelog

Since Simple:Press version 5.2.

Codex page sync’d to code version 5.6.0 and plugin version 1.2.10.

More Topics In SimplePress: Plugins


Copyright © 2006-2019 Simple:Press. All Rights Reserved.