July 10, 2007

Developing a Flexible Code Base

By: Ron Hall

Cat: TYP03, CSS, HTML

I have finally started a personal project I've been intending to tackle. The goal is to develop a code base and set of best practices for my web development efforts.

For sometime I have seen the need and benefits of the following:

  • Standardization of coding and development practices like naming and formatting conventions, directory structures, etc.
  • Development of a code base that can quickly be modified for a variety of situations. This includes the standardizing of approaches for common situations and the abstracting of code where possible for XHTML, CSS, Javascript/DOM Scripting, TypoScript, etc.

As part of this process I am beginning work on a Busy Noggin TYPO3 starter site and a code repository.

The basic starter site will simply be a TYPO3 installation with all the stuff I normally use and coded according to my preferences. It will include:

  • Extensions like TemplaVoila, PHP Page Content, Page Title Changer, etc.
  • The needed TypoScript
  • Standards-friendly and flexible page templates

The code repository will contain samples of additional extensions and my starter code for each plus notes on their installation and use.

The idea is to be able to load the basic starter site to a server and have a front end running within minutes. After that, other needed extensions could be installed from the TYPO3 TER and then configured by grabbing the code and adjusted templates from my code repository.

Putting together the starter site and code repository will help me work toward my main goal of the development of a code base and a set of best practices for my work. By pursuing the project and particularly sharing my thoughts with others, I am forced to think about why I do things the way I do and ask myself, "Is there a better, more sensible way?"

Throughout the process I will be sharing my thoughts and code. I am sure that by November I will wish that I could unsay some of the things I will have said in September. When that happens I will just tell you I'm an idiot and have changed my mind on that particular subject. I will then recode and we can all move on.

Hopefully some of the things I share will be of use to some of you in developing your own set of code and best practices.

 

Comments

We have attempted to do this as well.

one thing we did that speeds things up a LOT is to make a standard install, including usergroups, users (as neded) a standard page tree, and then export the whole thig to .t3d.

It saves the external typoscript files referenced in the templates along with everyhing else, and really speeds up install time.

we also standardized our naming practices, as we have about 4 folks working on sites... just simple stuff like naming menus menu_1_ts, menu_2_ts, content_normal_ts, content_border_ts, etc. is named the same in the html template, the typoscript temp. objects and anywhere else the same object is used.
Andrew Davis, 07/11/07
 
Ron,

I'd like to get involved in this discussion. As a starter, I'd open by suggesting a standard install of:

AWStats cc_awstats
Backend ACLs be_acl
CHC Forum chc_forum
Clear Cache for BE-Users cl_becache
Date2Calendar date2cal
Extended Calendar calendar
FE BE Library fh_library
Frontend User Registration sr_feuser_register
HTMLArea bg_htmlarea or rtehtmlarea??
KB Unpack kb_unpack
Library for Extensions lib
Meta tags, extended metatags
MK Wastebasket mk_wastebasket
Modern Guestbook / Commenting System ve_guestbook
New frontend login box newloginbox
News tt_news
RealURL: URLs like normal websites realurl
Searchbox for Indexed Search Engine macina_searchbox
SmoothGallery for TYPO3 rgsmoothgallery
Static info tables static_info_tables
Static Methods for Extensions div
TemplaVoila! templavoila
TER Update Check ter_update_check
TimeZone de_timezone
TIMTAB Weblog timtab
TYPO3 Quixplorer t3quixplorer
WEC Flash Player wec_flashplayer

Preconfigure basic User and Admin Groups
Preconfigure example Users and Admins
EXT templates folder set in fileadmin
Logical folder sttructure in fileadmin

Template options based upon http://blog.html.it/layoutgala/ which has 40 css page shapes with identical page code, just different CSS files.
Tony Lush, 07/13/07
 
Standardization of coding and development practices like naming and formatting conventions, directory structures, etc.

I would like to point the 2 "frame-extensions" lib/div that offer nice guide lines to extensions developers in a MVC style. lib/div are maintained and activily developed (these times) by the extension coordination team.

http://wiki.typo3.org/index.php/Extension_coordination_team

You could also drop your ideas in the mailling list. Thanks for your blog and your interesting readings !
Fabien Udriot, 07/20/07