Monday, November 28, 2011

Latest update - Form code

The form code is going through a rewrite this week... latest developments include:

  • New Element (completed) - AutoComplete - uses "james" to create an AJAX auto-complete text area:
$form->add( 'AutoComplete', 'name' )
->set_url('/action/GetGeneNames');
  • New Element (in development) - DropDownAndString - to allow for a drop down OR other option;
  • Additions of "groups" within sections - to allow for more complex layouts of form elements (rather than the single column), e.g. 2 col, 3 col (and eventually tab panels):
$form->add_section( 'test_section' );
$form->add_group( 'gp1', 'col12' );
$form->add_group( 'col1', 'col1', 'gp1' );
$form->add( 'Text', 'test_1' );
$form->add_group( 'col2', 'col2', 'gp1' );
$form->add( 'Text', 'test_2' );
$form->add_group( 'col3', 'col3' );
$form->add( 'Text', 'test_3' );
  • Fixed bug with "optional" entry validation


Tuesday, October 18, 2011

Pagesmith - State of the onion

Time for a state of the onion speech...

Pagesmith is nearly at what I would call an "Alpha" stage for distribution, we've been running our main production server (currently mainly static) on the code now for about 12 months, and we now have a number of smaller (mainly dynamic) about to be pushed live.

New features that are now present are:
  • Improved table code which includes "logic" to allow different styling and content for cells in a table depending on other values in the row;
  • Perl and Javascript implementations of the table, tabs and two-col rendering code take the same configuration structure (javascript version requires a JSON version of the perl configuration structure);
  • is_xhr on action to know whether request is AJAX or not;
  • "refreshable" class to allow AJAX requests to synchronously be updated.

Pagesmith changes this week

Changes this week include:
  • Fixed form action to get submit working correctly;
  • Fixed IE 7/8 CSS to format forms correctly;
  • First multi-page form to use the new form code ready to go live;
  • Moved javascript libraries to use latest jquery.1.6.4.js;

Tuesday, June 28, 2011

Why Template::Toolkit is bad - Component Based Design

Many people like Template::Toolkit and I see it's use a lot in Perl based websites. But I think that it is a bad design practice. In the past I've used Template driven design, where for each view I generate templates.

This works well to start with - but then if you want to tweak every table on the site or every tab panel you need to go in and change every set of templates - now I use "Component Based Design".

Components can be:

  • "structural":
    • Tables;
    • Tabbed panels;
    • Two-col definition lists;
    • Forms;
  • "inline elements":
    • "Protecting" Email addresses;
    • "Abbreviated" URL links (http://Xxx ... adsa/page.html);
    • Citations;
  • "Simple blocks":
    • Captioned (and floated) images;
    • Pull quotes;
    • Marked up HTML/Perl/JavaScript;
    • YouTube embedded videos;
  • "Complex blocks/applications":
    • References;
    • Image galleries;
By generating the HTML using perl code it is easy to tweak the way all components are displayed in one fowl swoop... By keeping the markup clean the look and feel (what the designer has to make look good) is done entirely in CSS, and functionality is driven in Perl.... far far better than the template culture!

PageSmith:: perl modules for making websites

I thought I'd start a brief blog about the new framework I'm working on at the moment, it is the culmination of 14 years of Perl and PHP development into a single easily extensible - but powerful integrated web framework:
  • standards compliant jQuery JavaScript code;
  • standards compliant CSS mark up;
  • standards compliant HTML;
  • mod_perl framework;
  • ability to integrate Java (via mod_jk) and PHP web services;
  • component (NOT template) driven design;
  • integrated development tools;
  • integrated SVN backed publishing system;
  • ...