Information Blocs – Usage Guide

 

Information Blocs – Usage Documentation

Installation

The Information Blocs plugin installs just like any Joomla plugin – just use the extension manager and upload the entire zip file.  Joomla will handle extracting the files and putting them into place.

Configuration

Before you can use the Information Blocs plugin, you’ll need to define some Bloc Sets which will be used to control the fields that will be displayed in a given Bloc.  Open the Administrator, and go to the Plugin Manage, then find the Information Blocs plugin.  You’ll be presented with the configuration screen seen here.

Bloc Sets are defined using a simple syntax, with each set being defined on its own line.  The syntax is as follows:

setname;header;field-ids
  •  setname
    • This is the name of the Bloc Set.  You’ll use it when you enter the short code into your article content.
  • header
    • This is text that you want to use as a title for the display bloc.
  • field-ids
    • This is a list of extra field ids, separated by a comma with no spaces, that make up the Bloc Set.  You can find these field ids by looking under the K2 menu item ‘Extra Fields’, where you’ll see a screen like the one below.  The field IDs are found in the last column to the right.

So, for example, to create a Bloc Set containing all non-review score fields, you would enter animeinfo;Series Information;1,2,3,4,5,6,7,8 on a single line in the Bloc Sets box.

Additional Configuration Options

  • Float Left CSS Class
    • Enter the name of the CSS class to be applied to blocs that need to be floated to the left.
  • Float Right CSS Class
    • Enter the name of the CSS class to be applied to blocs that need to be floated to the right.
  • HTML5 Aside Compatibility
    • If this option is enabled, the plugin will use an HTML5 aside element to wrap the display bloc, instead of a standard div element.
  • Split Values
    • If this option is enabled, the plugin will automatically split values separated by commas in text fields, as well as the values of searchable labels and multi-select boxes so that each item appears as its own definition list dd tag, rather than all in a single dd tag.
  • Enable QuickBlocs
    • If this option is enabled, the plugin will search for short codes which use inline data-value definitions, rather than a preset bloc set.  See below for more information.

Shortcode Usage

Once the plugin has been configured, it’s ready to be used.  Create a new K2 article, or edit an existing one, and choose where you would like to insert a display bloc.  At that spot, enter the display bloc shortcode:

[ibloc setname f]
  • ibloc
    • This tells the plugin that you want to insert a display bloc here.  You can also use ib.
  • setname
    • This is the name of the bloc set you want displayed here.
  • f
    • This is which side of the content you want the display bloc floated, and can be either l for left, or r for right.  If it’s omitted, the bloc will default to the left.

When the article is displayed, the plugin will automatically replace the short code with the requested set of fields.  If a field is empty, or unpublished, it’ll automatically be hidden for you by the plugin.  If the plugin is unable to match the supplied Bloc Set, it will remove the short code from the article display.

QuickBloc Usage

QuickBlocs work almost exactly the same as a predefined bloc set, except that you’ll need to supply the captions and values to be displayed in the shortcode itself.  This can be done with a shortcode like the following:

[ibloc {{header;caption1::value1::value2::valueN;caption2::value1::value2}} f]
  • ibloc
    • As before, this notifies the plugin that you want a display bloc to be inserted here.
  • {{header;caption1::value1::value2::valueN;caption2::value1::value2}}
    • This is the inline data that will be shown to the user.
    • Take special note of the format.  The header, and each set of captions and values are separated with the use of the semi-colon character (;).
      • Within a caption and value set, each item is separated with the use of a double colon. (::).
        • The first item in a caption and value set is used as the caption.
        • Remaining items in a caption and value set will be turned into a comma separated string.
        • Values are treated as a text field value, meaning that they’ll be split into individual dd elements by the plugin if it is configured to do so.
        • There’s no limit on the number of caption and value sets, nor is there a limit on the number of values within the set.
  • f
    • As before, this is which side of the content you want the quick bloc floated, and can be either l for left, or r for right.

When the article is displayed, the plugin will automatically replace the short code with the supplied inline data, IF quick blocs are enabled.

Display Bloc Styling

Information Blocs do not contain any default styling.  It outputs the requested field data as a definition list.  However, all elements within a display bloc are assigned CSS classes to facilitate styling by you.  These classes are as follows:

  • ibloc
    • Assigned to the display bloc’s container.
  • ibHeader
    • Assigned to the display bloc’s title h6 element.
  • ibList
    • Assigned to the display bloc’s dl list element.
  • ibCaption
    • Assigned to each dt element, which contains the extra field’s name.
  • ibBody
    • Assigned to each dd element, which contains the extra field’s value(s).
  •  Posted by JC on 2012/01/08 at 7:43 pm

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Optimized by SEO Ultimate