A Web Designer & Developer in Wichita Falls, TX. Working for Crane | West Advertising Agency.
James Fleeting
 
23 Feb

QTT: Custom Templates in Kaizen CMS

First a brief intro into Kaizen. Kaizen CMS is still a relatively new (or at least new to the public) content management system that was started by John Hoover back in 2007. The cms that exists today is far from the initial and started to take shape in August of ’09 and released as open source to the public in January 2010. I’ve worked with John for over a year now (at DigiMedia and now at Crane|West) and joined him in development of this project in October ’09. It still has areas we are improving on but is the basis we start all of our sites with. The source is hosted on Github and the project is opensource so feel free to fork and explore the code. The project is in active development with lots of improvements in the works.

Now onto the quick tip for today. I’m going to show you how easy it is to create a custom template in Kaizen CMS. Its honestly as easy as one line of code and the cms already has an example of this in ./views/content/contact.tpl file. A custom template is a great way to provide a different look to different pages without affecting the overall site appearance. You might have a page that you don’t want the sidebar to show up on or a page with a completely different header and footer. Kaizen allows you to do this easily without almost no effort on your part. We use smarty for the templates as well. Lets look at the code for the main content template (./views/content.tpl).

Copy to Clipboard
1
2
3
4
5
6
7
8
9
10
{include file="inc_header.tpl" page_title=$aContent.name|clean_html menu=$aContent.tag}
 
	<section id="content" class="content">
		<h2>{$aContent.title|clean_html}</h2>
		{$aContent.content|stripslashes}
	</section>
 
	{include file="inc_sidebar.tpl"}
 
{include file="inc_footer.tpl"}

Line 1 does three things. First it includes your header file, in this case it’s inc_header.tpl, then it sets the page title using the content name (page title set in the admin) and last it sets the menu tag (this lets you tell what page your on and can then set a class on your menu to show that. Line 4-5 is displaying the content for the page, so nothing special. Line 8 & 10 are just including the sidebar and footer.
(more…)

14 Nov

Future Development

One of my latest client work has been a custom php/sql Team Management System for a soccer club. The goal of the system is to allow each team to have their own dynamic page to include their own schedule, snack schedules, coach information, etc. The coach is able to update all their information from their dashboard. Everything is generated on the site so we can generate team lists and coach listings elsewhere on the site just calling the database. The plus is allowing the coaches to control their own information and a quicker way for them to get information to their team/parents. The system is being written in php/sql. I have to have a working demo (read: rough demo) by Friday for a lunch meeting with the client. This isn’t really a problem as its mostly showcasing the features and mainly the flow of information inside the system and discussing features. The system doesn’t need to be complete until the end of December. I’m learning a lot of new things with this system. I’ve never messed with dynamic pdfs but for this system will be using fpdf to generate pdf’s of schedules, team roster and contact sheets. This will be great for the coaches and parents to have printable ready pdf that are generate with the latest info. The pdf’s will be branded with the club logo, etc. I am also working with mod_rewrite for the first time. Which is not going great. I had nothing but problems. I think I’ve since figured them out but won’t test it until tomorrow. The goal is to redirect team subdomains (teamname.clubdomain.com) to the team directory (www.clubdomain.com/teamname). Looking forward to showing the system to the client during our lunch meeting on Friday and discussing new pricing. I’ll let you know how it goes.

I love working with php however am looking at learning a new language. The top of my list is Ruby on Rails. I’ve always been interested in it but have never had the time to just sit down and learn. I know a few other people who use Ruby so I hope to take the plunge and start working with Ruby in December. I have a few client work to finish this month before I can take the time to spend with it. I also need to spend sometime with javascript. I know the basics and enough to modify current scripts to work for what I need but as far as writing one myself, can’t do it.