Package Contents

Snippets Installation

  1. Copy the folder 'snippets' from the 'manager' folder in this package to /skyblue_root/managers/snippets in your SkyBlue site
  2. Copy the file 'plugin.snippets.php' from the 'plugin' folder in this package to /skyblue_root/data/plugins/ in your SkyBlue site

About Snippets

Snippets is an add-on for SkyBlue that allows you to add arbitrary bits of text or code to your site that do not neatly fit into any of the other managers for specific data types such as a gallery, links, case studies, etc.

When you create a Snippet (more on this later), the Snippets Manager will generate a unique token that you can then paste into your template or page text. When the page is rendered by SkyBlue, the token will be replaced with the content of the Snippet.

The Snippets add-on consists of two pieces: the Snippets Manager and Snippets Plugin. Each piece of code playes a different role.

Snippets Manager

Snippets Manager provides the interface for you to be able to create, edit and delete snippets.

Snippets Plugin

The Snippets Plugin replaces the token with the Snippet content.

Snippet Types

There are two types of Snippets: plain text and WYSIWYG (what you see is what you get).

Plain Text

Plain text snippets allow you to add raw text, HTML, CSS or JavaScript to your site.

WYSIWYG

WYSIWYG Snippets give you the familiar Microsoft Word-like editor that allows you to created styled text.

How to Use

  1. Log into your SkyBlue admin at http://yoursite.com/admin.php
  2. From the main Dashboard, click the "Collections" button
  3. From the Collections dashboard, click the "Snippets" button
  4. From the Snippets List view, click the "Add" button
  5. You will see a screen with a single selector labeled "Type". Select 'Text' or 'WYSIWYG' depending on which type of Snippet you wish to create.
  6. Click the "Next" button
  7. Enter a name for your Snippet that:
    • Is unique
    • Is meaningful and easy to remember
    • Contains only letters, numbers and underscores
      The snippet name is the machine-readable name and is used for the CSS ID as well as by the Snippet Manager and Plugin to identify the Snippet.
  8. Enter the body of your Snippet in the textarea (text) or editor (WYSIWYG)
  9. Enter an optional link - this is a web address to which the snippet should link
  10. Copy the token that appears at the bottom of the page. This is the token you will paste into the page text or template where you want your Snippet to appear on your site. The token will look like this:
    {snippet(your_snippet_name)}
  11. So that you can target style rules to your Snippet, the Snippet will be wrapped in HTML with the following format:
    <span class="snippet" id="your_snippet_name">
        { Your Snippet text here }
        <span class="link">
            <a href="{ Your Snippet Link }"><span class="linktext">{ Your Link Text }</span></a>
        </span>
    </span> 
    
  12. Click Save
  13. Paste the token you copied above, and paste it in any page text or template on your site.