This is the online demonstration of the I-Metrics CMS v1.11 (Stock Template 2 Columns SEO)

Alternative Content Display

Monday 12 April, 2010

he Alternative Content Display plugin allows the visitor to display a text page in printable format. There are no configuration options but there are template dependencies. Edit the alt_display.tpl for the template you are going to use to setup the icon for the printing button.

The Alternative Display Plugin was introduced with version 1.11. Under the default configuration it deploys a form at the end of text pages and hooks into the primary HTML calls in the framework. Once the user clicks one of the alternative buttons of the form, the Plugin inhibits propagation of the HTML calls and takes over the display content.

In the first version 1.00, all the Alternative Content Display Plugin does, is to override the default HTML sections and displays the content in a plain format suitable for printing. The whole idea behind it, is to expose the primary HTML hooks that control the stylesheets and HTML document properties. When the user clicks the print button the Plugin responds to the following calls by emptying the HTML tags arrays:

  1. html_start_sub1
  2. html_start_sub2
  3. html_body_header
  4. html_content_bottom
  5. html_end 

Therefore menus, side columns, javascripts and CSS related entries aren't executed in this scenario as the Plugin empties the arrays responsible setting up the HTML/CSS/media resources. Here is code sample hooking up the html_start_sub1, cleaning up the associated array for the document type and media resources.

function html_start_sub1() { global $html_start_sub1; if( $this->post_request !== false) { $html_start_sub1 = array(); } return true; }

The same exact code is used with the other hooks with the only difference being the hook name. For regular browsing ie: when no print button is pressed all the plugin does is to dsiplay a form with the button at the end of a text page.

The code can be extended to support different formats. For instance if we wanted to produce a PDF format out of the text page upon hooking the content we could buffered the output and process the page contents using a PDF library then generate a PDF file.

There are no comments on Alternative Content Display

Leave a comment
Your Name:
Your E-Mail (will not be published):
Your Website:
Your Comment:
Rate it:
Bad
Good
Cast a Vote
Did you find Alternative Content Display useful?
No Very

Using the advanced Plugin system of the I-Metrics CMS create your own plugins or integrate existing ones to gear your website around your niche.

This section contains technical information of the Plugins Manager, integrated Plugins and each of these add-ons operates on the web-front and back end of the framework