Boyinks4Adventure.com - About

This code handles both the index and single-entry views for the About Section on Boyinks4Adventure.

 
Download the EE Code for Boyinks4Adventure.com - About

Overall this is a pretty straightforward example of a one EE template that uses Segment Variables and conditionals to function as two templates. 

The first view is the index view, or what you get when you just click the “About” link in the main navigation.  To build these abbreviated versions of the single entries the template uses a couple of third-party plugins - Image Sizer from David Lumis and the Word Limit Plus.

The second type of view is what you get when you navigate deeper in the content and choose a single entry.  This template is again loaded but since there will now be a value in the segment_2 position different parts of the template are rendered.  The Image Sizer plugin is again used to prevent the often-forgetful client from uploading an image that’s too big.

I had two reasons for choosing this coding approach:

1 - I didn’t really have unique content for the index page.
2 - I wanted clean URLs for my single-entry pages.

Combining both multi and single entry logic into one template worked for me in this case.

Take a look - and steal whatever you need to steal to accomplish any similar requirements you have with your projects.

 

Category Navigation

Next Entry >>

 

Previous Comments

Picture of Ray Brown

by Ray Brown

Date: Monday, June 7th, 2010
Comment: #1

Hey, Mike…this is pretty awesome.  We definitely should show more of our code, and this will really help give that “ah ha!” moment to new EE devs.  Also, it’s always entertaining to inspect other peoples’ code.

Keep up the great work!

Mike Boyink

by Mike Boyink (Author)

Date: Tuesday, June 8th, 2010
Comment: #2

Thanks Ray!

Hoping to inspire other devs to follow suit and show some code where/when they can.  We see finished sites and talk about little bits and pieces of code but rarely see full unrendered templates.

Add Your Comment

Commenting is not available in this channel entry.

Unless otherwise stated all content is © Michael Boyink of Train-ee.com & Boyink Interactive. Please don't steal - I've got kids to feed...

dy>