Code Sample, Version 1.2
Works with B2veolution 2.4.2+ released on 8/11/09
Short Description
Highlight samples of text using different coloured text boxes.
Detailed Description
The codesample_plugin gives you the ability to easily add different coloured boxes to your blog. Use the boxes to highlight blocks of code or text. There some colours setup already and used as default. you can add your own colours using the HTML colour names
As listed here
You can also add an icon to highlight the box to indicate that text or sample is special just add the attribute
image="info" to the tab. Also a title can be added with the title attribute as in
title="Example text:"
Since I am unable to draw a line let alone an icon there are no icons provided with this download. You can simply add your own by copying them to the code_sample_plugin/img directory.You can also add the your own icons to the blog media directory in a subdirectory called img. This will make it easy to add new icons to splash around your blog
All text highlighted with the [coloursample]THIS TEXT HERE[/coloursample] is pre-processed to convert &=> & < => < and > => >. This will allow you to paste in code samples with out worrying about their format.
The code sample plugin also adds a new toolbar to the Expert editor.
Installation
- Upload the code_sample_plugin folder into the "plugins" folder.
- Login to the back office.
- Install (Go to: Global Settings -> Plug-ins -> "Available plugins", click the [Install] link).
Customisation
- Login to the back office.
- Global Settings
- Plugins Install
- Click the link for Code_Sample
You can now edit the list of colours you want to make available in your blog. Each colour is added separated by one or more space character. If you do not want "black" to be the colour of the text used in the code sample box then simply add a contrasting colour by adding a colon ":" and the the foreground colour. For example when displaying a black box black text will not show up very well :-). So we will use silver as the text colour that will give us an entry of
black:silver
User Customisation
- Login to the back office.
- Users
- Scroll down to the Code Sample section
Each User can select to display the Code Sample toolbar when the editor is in
Expert mode
When
Create Empty Tags is selected and you use the menu option to generate the code sample tags, the empty attributes for text and image will be generated for you. Saves typing

. Then to clean up those unused attribute tags select
Remove Empty Attribute Tags.
Usage
Add starting and ending tag, for example [greysample] and [/greysample] tags. Then add the optional text="Title text", image="info" and pre="0|1" attributes.
Pages: 1 · 2