PHP XTemplate: Import Files

In the previous two tutorials on XTemplate, I discussed the basics of tag assignment and dealing with dynamic blocks, but the real power of using a templating system comes when you are able to use the same basic layout template on more than one page while displaying different content. XTemplate allows us to import template files into an existing template, allowing us to maintain a site structure on each page, but the true power comes when we need to make changes to the layout. Edit one file and the changes go into effect for all the pages using that template. Continue reading

Advertisements

PHP XTemplate: The Basics

I have used FastTemplates for my PHP templating engine for years now, but it seems it is no longer supported. I still like it. It works well with some projects, but I decided maybe it was time to move on to something new. In my search, I came across a post from Web Resources Depot listing 19 PHP template engines. Some of these I knew (like Smarty), and most seemed more complicated than I needed. Let’s face it, I want to create web sites and develop PHP packages not learn a whole new markup system. Continue reading

Reading XML with PHP, The XML Document

I have found many situations where being able to read the information in a XML/RSS file has come in handy. For example, putting a block on a page with the latest entries from a blog. Since XML files are basically structured flat databases, I use them sometimes for short collections that do not require security.

XML files are not difficult. You don’t need a fancy, expensive program to generate them, and PHP has functions built in to read and manipulate them. Continue reading

MegaGallery, Part 3: Dress It Up with CSS

In part 3 of the MegaGallery project, we will takes the first steps in dressing up our gallery. Up to this point, I have been more concerned with the programming side of the project, which is where I often start. We have reached a point now where some style and design is a good idea before continuing with programming. Continue reading

MegaGallery, Part 1: Slimbox

I have never used Slimbox before; so, right out of the box, I wanted to make sure I could get it to work. Slimbox2 is a plugin for jQuery for displaying images in an overlay window. You have probably seen the overlay effect before (some sites use it an annoying answer to pop-up ad blockers). Continue reading