What’s all this about controls and tokens?

Controls, in Pixelsilk, are essentially dynamic blocks of content that can be inserted anywhere in a theme page, skin, and/or content.

Controls, in Pixelsilk, are essentially dynamic blocks of content that can be inserted anywhere in a theme page, skin, and/or content. When the system renders a page, it replaces any controls found with the appropriate content.

A control is represented by a special format called a ‘token.’ A token is the name of the control surrounded by double brackets; for example, a control named “MyName” would be inserted into a content page as [[MyName]]. When Pixelsilk encounters [[MyName]] when preparing the page, it will substitute the value of the “MyName” control.

Controls Slideshow Overview

Tokens Slideshow Overview

Where do I create these controls?

Controls are created and managed in the ‘Design’ section, under the aptly-named ‘Controls’ tab. A new Pixelsilk site will have no controls; as a site is created, the developer will gradually build up a library of controls that will become essential to the functioning of the site.

Adding a control is as simple as clicking ‘Add New Control’ (see Example 1.3 below):

Example 1.3
ex1-3.jpg

 

Simply select a ‘Control Type’ and give the control a name.

 
(For the purposes of this example, we’ll stick with the selected ‘HtmlWebbox’ and use the name “MyName.”)

An ‘HtmlWebbox’ control is essentially a container for a snippet of HTML content that can be re-used anywhere the [[MyName]] token is encountered. The primary purpose of this control will simply be to display the Web Developer’s name, only with some additional markup to make it stand out.

This is accomplished by adding the relevant content to the ‘Content Skin’ of the control. Simply click the pencil icon for the control to edit its properties, and select the ‘Skins’ tab (Example 1.4 below):

Example 1.4

ex1-4.jpg
Clicking on the pencil icon for the ‘Content Skin’ will present an HTML editor form exactly as seen in Example 1.1, “How do I edit my theme HTML?” You could enter just a name (“Arthur Dent”) or mark it up with HTML:

Arthur Dent


What are those other tabs on the control editor?

The ‘Options’ and ‘User Permissions’ settings of a control greatly expand the flexibility available for how a control will behave.

‘User Permissions’ is exactly as it sounds; it allows granular control over various user-level access to a control, including view and edit rights to the content it contains. Different rights can be set on a role-by-role basis.

‘Options’ defines additional behavior options for a control. The most common option is Page Limitation, which means the control can be specifically included or excluded from a page, a set of pages or an entire section. This becomes useful if, for instance, you have a Google Adsense control that you are not allowed to display (per Google’s Terms of Service) on contact form and search results pages; simply exclude the control on the relevant pages, and when one of those pages is rendered by Pixelsilk, that control will not be included as part of the output.

 

What are some other control types?

Pixelsilk comes out-of-the-box with a set of predefined control types with specific behaviors and purposes; a full accounting is beyond the scope of this example and will be available via training but a short list is:
  • HtmlWebbox, TextWebbox, ImageWebbox: all for the purpose of displaying content that may be static
  • Menu: for building (dynamic) menus based on the section hierarchy of content
  • Breadcrumb: for building breadcrumb navigation
  • SiteMap: for building a site map automatically from the section hierarchy of the content
  • ListFeed: for selecting and displaying (dynamic) data from a list section
Back to list...