cwsoft-shortcode module for CMS SilverStripe 3.x
This module provides some handy shortcode methods ready to use from your SilverStripe CMS WYSIWYG editor.
cwsoft-shortcode module builds up on the shortcode function first introduced with SilverStripe 2.4. Shortcodes can best be thought of a kind of placeholders entered in the WYSIWYG editor, which gets replaced with PHP output just before beeing displayed on the screen. This allows to add dynamic content to a specific position inside a WYSIWYG page. The available cwsoft-shortcode methods can easily be selected from the WYSIWYG editor.
cwsoft-shortcode methods provided:
- cwsHideMailto: obfuscates the mailto part of mailto links
- cwsRandomQuote: displays a random quote from a text file
- cwsRandomImage: displays a random image from your assets folder
You can download an archive of the latest development branch of the
cwsoft-foldergallery module using GitHubs ZIP button. The archives of previous module releases can be found in GitHubs Tags section. The development history is tracked via GitHub.
Note: An older, but unsupported version for SilverStripe 2.4.x can be found and downloaded in the 2.4.x branch at GitHub.
The cwsoft-shortcode module is licensed under the GNU General Public License (GPL) v3.0.
The minimum requirements to get the cwsoft-shortcode module running on your SilverStripe installation are as follows:
- SilverStripe 3.0.x or higher (recommended last stable 3.x version)
- PHP 5.3 or higher (recommended last stable PHP 5.4.x version)
- download latest module archive from GitHub
- unpack the archive on your local computer
- upload the entire cwsoft-shortcode subfolder to your SilverStripe root folder using your preferred FTP program
- update your SilverStripe database via
To use the shortcode methods provided by the
cwsoft-shortcode module, just follow the three steps shown in the sketch below.
- position the text cursor to the location you want insert the shortcode and press the Plugin icon (coffee cup)
- select the shortcode you want to use and press the insert button
- update the shortcode skeleton code with your data (e.g. image path, image orientation, mail address ...)
[cwsHideMailto firstname.lastname@example.org' subject='optional_mail_subject']mail_link_text[/cwsHideMailto] [cwsHideMailto email@example.com' subject='optional_mail_subject']
This shortcode allows you to displays a random quote from a textfile located in a subfolder in /assets.
The textfile containing the quotes must follow the conventions below (ensure that the first line of your CSV file exactly matches the example below, including upper/lower case):
"Quote"|"Author" "your first quote goes here"|"author name" "next quote goes here"|"autor of this quote"
Tip: You can adjust the output to your needs via the template file cwsoft-shortcode/templates/Include/RandomQuote.ss and the CSS file cwsoft-shortcode/css/cwsShortCodeRandomQuote.css.
This shortcode allows you to display a random image with a jQuery ColorBox effect from a subfolder in /assets.
[cwsRandomImage folder="subfolder_in_assets" align="left|right"]
Tip: You can adjust the output to your needs via the template file cwsoft-shortcode/templates/Include/RandomImage.ss and the CSS file cwsoft-shortcode/css/cwsShortCodeRandomImage.css.
Known issues can be tracked and reported via GitHubs issue tracking service. If you run into any issues with the cwsoft-shortcode module, visit the issue tracker and check if a similar issue was already reported. If not, just add a new topic descriping your issue.
If you have questions or issues with cwsoft-shortcode, please visit the SilverStripe forum thread and ask for feedback.
Always provide the following information with your support request:
- detailed error description (what happens, what have you already tried ...)
- the cwsoft-shortcode version used
- your PHP and SilverStripe version used
- information about your operating system (e.g. Windows, Mac, Linux) incl. version
- information of your browser and browser version used