Boyinks4Adventure.com - About
This code handles both the index and single-entry views for the About Section on Boyinks4Adventure.
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






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!