logo       

new theme in development : 'templates': msg#00974

php.drupal.devel

Subject: new theme in development : 'templates'

Recently , I have made some modifications to the marvin_2k theme in contrib , which had recently moved over to a more templatised approach using php only templates (ie: <?php print $value; ?> ).

I started by porting over the functionality in the latest xtemplate that allows one to select from different templates available, and then i followed that up
by adding the code that allowed you to select wether to use avatars or not.

At this point, I realized that I have essentialy copied / pasted and global replaced a intolerably large amount of code .. and that there must be a smarter way to do this.

So, i created a new 'templates' theme, which has all the generic functionality as is neccesary for just about all template based theme, which in turn include
and extra 'template engine' file, which handle the half-a-dozen (or more) template engine specific code.

I then use file_scan_directory , to pick up available templates .. and match them to their corresponding engine via the filetype. This done , I converted
xtemplate, and marvin_2k (using xtemplate and phptemplate template engines)
to the new layout , and will probably do a phptal/smarty engine sometime in the future.

The system reconfigures itself if you write a new template engine plugin , and automatically picks up files of that type. The value of this, is that the user
is capable of using whichever templating engine they most feel comfortable, without getting bogged down in drupal internals at all. It also delivers a set of functionality across all template engines that are verified to work

At this point, the only major functionality it is missing is the comments, but that should be sorted soon enough. I am already running http://staging.oasismag.com off of my modified marvin_2k theme, and converted the template i had written for it to the 'templates' structure within a few minutes.




--
Adrian Rossouw | Jabber: adrian@xxxxxxxxxxxxxxxxxxxxx
Web Application Developer | Icq : 735289
Observe - Witness, Behold, Observe. | Aim : vertice123
A Division of Obsidian Systems. | Yahoo : vertice123
http://www.observe.co.za/ | Msn : vertice123@xxxxxxxxxxx
--------------------------------------------------------------------------
Most people are other people. Their thoughts are someone else's opinions,
their lives a mimicry, their passions a quotation.
- Oscar Wilde, De Profundis, 1905



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise