Token Rendering Plugin

The Token Rendering Plugin (TRP) was inspired by the desire to make use of page-specific information in the title and meta tags when pagination is in force in list sections. If there are enough list items in the section, it will take several pages to display them at, say, ten list items per page. Normally the list section information appears on those pages. This plugin is a way of specifying different content for a token when it is rendered. Whatever it would have been rendered as is replaced by what is dictated in the TRP. As one might expect, any token handled in the TRP must be a token known about by Pixelsilk on the website using the plugin.

Of primary importance in the use of the TRP are URL's and tokens. Tokens are associated with URL's. A user interface is provided that facilitates storing a URL with as many tokens as are needed for the given page. For each token its name and content are stored. It is this stored content that will get rendered instead of what would have been rendered for the token. Although this plugin was inspired by the needs of list item detail pages, it can be used for any page.


The URL for a page to be handled by the plugin is the URL the page is actually addressed by in the website. It is the URL that appears in the browser's address bar when that page is loaded. The TRP's editor provides a way to enter and save that URL.

The Tokens

To associate a token with a URL, it is necessary for that token to be one of the tokens Pixelsilk is actually using. The TRP's editor provides a way to associate tokens with a URL. In the editor a token is entered with its name and the desired content. In this way Pixelsilk can be instructed to render the token differently than it would have rendered it otherwise.

The Editor

The TRP's editor resides on the Plugins tab in admin. In the list of plugins find the Token Rendering plugin. At the right end of its bar is a button that looks like a page. Click that button to open the editor.

Token Rendering Plugin Bar

Add Page Url

At the top of the editor is a bar whose text is "Add Page Url." Click the bar to expand it. A tab appears with a textbox in which the URL can be entered. Enter the URL and save.

Add Page Url Bar

Add Page Url Tab

Below the "Add Page Url" bar is a list of URL's each with its own bar. The URL just entered and saved should now appear in that list. There are two buttons: the pencil for editing and the "X" for deleting.

Url Bar

Add Token

To associate tokens with a URL, click the pencil on that URL's bar to expand the bar. When the bar is expanded, a tab appears containing an "Add Token" bar and a textbox for each token that has already been entered and saved. Each textbox has a delete button beside it so the token can be removed from the TRP's data. Once a token is deleted its rendering will revert to the normal rendering Pixelsilk uses for that token.

Edit Url Bar

Click the "Add Token" bar to associate a new token with the page whose bar has been expanded. Provide the name of the token and its content. Then save it. Now a textbox is added to the tab for the new token. Future changes in content can be made in that textbox. Make the changes and save.

Add Token Tab

Edit Token Content

As shown above, tokens that have been added are given textboxes for subsequent editing. When a URL bar is expanded, the token textboxes will be populated with the current content stored by the TRP. To change the content, edit the textbox text and save.

Back to Plug-ins »