ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Best Practices Question

July 08, 2007 12:48am

Subscribe [2]
  • #1 / Jul 08, 2007 12:48am

    dshafer

    7 posts

    I have what for me at least is an intriguing best practices question.

    Given an existing site whose directory structure looks, in relevant part, like this:

    root
    __public
    ____benefits.php
    __members
    ____benefits.php

    where the two PHP files differ from one another only in the inclusion or exclusion of one or two components (which will presumably become embedded Weblogs in EE), what is the best strategy for organizing the content in EE?

    1.  Sectioned as at present with completely separate templates

    In this case, I’d have one template group called public, one called members, and each would have a template called info which would have several entries, one of which would be named benefits. The URLs would be:

    http://www.mysite.com/public/info/benefits
    http://www.mysite.com/members/info/benefits

    2.  Structured more along common content lines to reduce total number of templates

    In this case, I’d have a single template group called, perhaps, info, and a template called benefits which presents the proper content elements depending on whether the user is a logged-in member or not. (I’m not yet 100% clear on how I’d invoke the conditional logic here but I’m sure it can be done.)

    In this case, I’d have a URL:

    http://www.mysite.com/info/benefits

    which would show one page view to members and one to non-members.

    Perhaps more accurately and consistently, since I may have several pages that could share a template, I’d add a template called “details” and the entities would be called “benefits” and other similar names, resulting in a URL like:

    http://www.mysite.com/info/details/benefits

    The former seems cleaner and more understandable in terms of traditional UR reading, but the second one seems more elegant and efficient because it only needs one template.

    Perhaps there’s a third way I’m overlooking?

    All insights appreciated.

  • #2 / Jul 08, 2007 7:12am

    Sue Crocker

    26054 posts

    http://www.mysite.com/info/details/benefits

    If you want to segregate content based on logged in or not logged in members, you could have a members and non members field to post that sort of content.

    I’d go with the second case. If someone goes from being a non-member to a member, their links don’t change.

    Does that help?

  • #3 / Jul 08, 2007 12:43pm

    dshafer

    7 posts

    Thanks, Sue. That does make some sense. The URL scheme in EE is pretty cool and straight-forward, it’s just different enough from how I think about URLs that I periodically have to go back and re-re-re-re-read the docs.
    :coolsmile:

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases