We are embarking on a major drive to increase website conversions on our Booking Site. Driving traffic to the site is not especially difficult but, once there, the traffic doesn't convert very well.

If we are to start carrying out A-B testing of incremental improvements, we need to be able to adapt the look, feel and functionality of the site quickly and relatively easily. The site is written entirely in Perl (of course) with MariaDB database. But the Perl scripts do not use any kind of templating. Instead they have the HTML, CSS, JavaScript, etc hard coded along with the functional logic.

There are two require files, one provides common code to connect to the database, set the environment etc along with common subroutines. The other provides subroutines to output standard parts of webpages like the header, navigation, footer, etc.

As we are looking to make changes to drive Conversion Rate Optimisation (CRO) it seems sensible to refactor the website to implement Template. But - I have no idea where to start!

What suggestions can you give to start to plan a project to refactor the website to use templating?
What are the hidden pitfalls that could trip me up and suck up vast amounts of time?


In reply to Refactoring webcode to use templates by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.