Entries tagged "template"

Avoid Code Duplication Caused by ExpressionEngine (v2.6.1) Not Letting You Reuse Names in Channel Field Sets

I developed a content template in a CMS called ExpressionEngine. Everything seemed simple enough until I was asked to incorporate a few extra fields that were commonly used in other content templates. Since the website was using an outdated version of ExpressionEngine that didn’t let you use the same field name in multiple content templates, I ended up duplicating a lot of code that's used to display these common fields. Well, it turns out that there is a better way. [Continue reading]

Position Photoshop Slices Precisely with X,Y Coordinates

When developing websites, it may be necessary to convert Photoshop compositions into website templates. One could manually crop the file into its various components and save them for the Web, but the process becomes very tedious. Especially when there are dozens of individual images needed from the original composition. That's where slices come to the rescue. [Continue reading]

Thoughts from the CyberScorpion.com Redesign

It's finally done. The CyberScorpion Bytes blog has been redesigned! When switching to WordPress a few years back, a pre-made theme was chosen for the design so I could hit the ground running with the blog. It was never the plan to stick with that template. I wanted to build my own. Now that it's done, I wanted to share some thoughts. [Continue reading]

Rethinking the Structure of My Templates

Over the past few years I've been working on an initiative which shares a single template over several websites. The overall process has gone fairly well, but my standard process for building templates in PHP isn't holding so well. The number of files could use some pruning and there have been issues with variables and helper functions not being available when needed. Plus, it would be nice to have a common place where overall website setting could be changed to affect all pages. So it's time to rethink my template-building process. [Continue reading]

How to Avoid Conflicting Variable Names

On occasion, variables in PHP may conflict. This is easy to avoid when all the code appears in a single file. What happens when code is scattered throughout the website? Maybe there are variables tucked away in a template file which is brought in with a PHP include. How do you avoid conflicting variables within a file that's used by many other pages on the website? [Continue reading]

Developing a Simple Website Template with PHP

When developing websites it's always a good idea to look for ways to make the final product easier to maintain. For websites which contain more than a couple of pages, it can be a real time saver if you build them utilizing a template. [Continue reading]