Jump to content

BMX magazine site


thomas
 Share

Recommended Posts

Hi everyone,

I refused to switch to another CMS for many years. I worked with a Perl based self-made CMS that produced no markup and provided the basic tools to fill templates with life. After being pointed to PW by a friend I finally made the switch since our CMS is dated and needs to much work to keep at a reasonable level (UTF8 support among things). PW is what we wanted our CMS to be!

So I just released my first PW project into the wild: http://bmxrider.de

I quickly found myself at home in PW since the workflow is just the one I was used to. I could never make myself use webforms to edit templates or even have my stylesheets in a DB.

I used an approach similar to Ryan's described here: http://processwire.c...legate-approach , with a little modification to keep the amount of PHP in my templates to a minimum. My "home" template looks like this:

<?php
include('./tools.inc');
ob_start();
$news = $pages->find("parent=/news/,sort=-created,limit=3");
$videos = $pages->find("parent=/video/,sort=-created,limit=3");
$aktuelles = $pages->find("parent=/news/|/magazine/|/video/|/termine/,id!=$news|$videos,sort=-created,limit=5,");
include('./news.inc'); ?>
<div id="content-sidebar">
<div id="content-left">
<?php include('./videos.inc');?>
<?php include('./aktuelles.inc'); ?>
</div>
<?php include('./sidebar.inc');?>
</div>
<?
$page->body = ob_get_clean();
include('./main.php'); ?>

I'm already working on the next PW project and hope to switch all of our company's sites better sooner than later. Thanks for a great product and community!

thomas

Edit: I forgot to mention the PW credit: http://bmxrider.de/impressum/

... and also forgot to mention that I my only problem with PW is that it's PHP based. Perl is just much more fun! But I guess I'll get over that ...

Edited by thomas
  • Like 8
Link to comment
Share on other sites

The site looks great. First time I've seen output buffering used in a PW template, I think. Can you explain why you chose to use it?

Hi Marc,

I used output buffering to avoid echo lines. This way I can include a bunch of reaccuring html snippets (news.inc, videos.inc ...) which are almost straight HTML (with little <?=$something;?> in it) and put it all into the $page->body variable. At the end, I include main.php where $page->body displays the page content. I found the code a lot easier to read this way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...