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.

New EE guy (WP background) looking for setup recommendations

November 01, 2013 1:54pm

Subscribe [2]
  • #1 / Nov 01, 2013 1:54pm

    Andrew Barden

    2 posts

    Coming from a long and fruitful Wordpress background, I’ve tasked myself to dive into EE for a current project.

    Project details: A corporate website with these unique templates:

    – Home
    – Secondary/tertiary (subtle variations; unique custom fields per)
    –– user should be able to choose whether to use a static hero image, a slideshow with bullet navigation or a slideshow with thumbnail navigation)
    –– user should be able to choose whether the hero appears above or below the lead-in
    – Variations on Secondary/Tertiary: Home Care, Dimensions…, Find Your Home
    – Blog / Single (syndicated)
    - Resident Spotlight (syndicated) / Single

    With Wordpress, this would be an easy task because I’d create “page” and “archive” templates for each of these unique templates. I would then conditionally assign a set of custom fields to each template—some templates would share a generic set of custom fields.

    With ExpressionEngine, I am using Structure, Playa, Matrix, and Low Variables to achieve my goals, but I’ve got a few hangups I’m trying to work through:

    Because field groups are assigned to channels rather than templates within a channel, the only way I can think of to get unique treatment and field sets per-“page” is through creating a channel for each page type:
    - Home
    - Dimensions of wellness
    - Find Your Home
    - Resident Spotlight
    - Primary
    - Secondary
    - Tertiary

    With Structure, when I create a new “page”, I’m able to choose which channel/template to use.

    However, creating a channel for each template seems like a disorganized way of going about things—where I really want a channel called “pages”, and depending upon which “template” is chosen per page, conditionally displays custom fields. The biggest barrier from me doing that, is I don’t want the client to see all fields possible for the channel, because it would be an awful and confusing management experience.

    Can I get some opinions on whether I’m following the right path, or if there are better ways to accomplish my goals?

  • #2 / Nov 02, 2013 9:51am

    Rob Allen

    3118 posts

    Secondary/tertiary (subtle variations; unique custom fields per)
    - user should be able to choose whether to use a static hero image, a slideshow with bullet navigation or a slideshow with thumbnail navigation)
    - user should be able to choose whether the hero appears above or below the lead-in

    For your image variations I would set up 4 custom fields:

    Hero type (tells us what type to use)
    - Checkbox or Radio fieldtype, options “Image” or “Slideshow”
    - field short name cf_hero_type
    Hero image
    - File fieldtype
    - field short name cf_hero_image
    Hero position
    - Checkbox or Radio fieldtype, options “Above” or “Below”
    - field short name cf_hero_position
    Slideshow
    - Grid fieldtype, columns for image and caption (plus others if you need)
    - field short name cf_hero_slideshow, plus column short names eg hero_slide_image hero_slide_caption

    Then in your template add some conditionals to output stuff

    {!-- do stuff if there we want to use a hero image --}
    {if cf_hero_type == "Image"}
    
    {if cf_hero_image != ""}
    
      {if cf_hero_position == "Above"}
        {cf_hero_image}
        Your lead in stuff, probably a custom field?
      {/if}
    
      {if cf_hero_position == "Below"}
        Your lead in stuff, probably a custom field?
        {cf_hero_image}
      {/if}
    
    {/if}
    
    {!-- do stuff if there we want to use a hero slideshow--}
    {if cf_hero_type == "Slideshow"}
    
      {if cf_hero_position == "Above"}
        <ul id="slides">
        {cf_hero_slideshow}
        <li>{cf_hero_slideshow:hero_slide_image}</li>
        {/cf_hero_slideshow}
        </ul>
        Your lead in stuff, probably a custom field?
      {/if}
    
      {if cf_hero_position == "Below"}
        Your lead in stuff, probably a custom field?
        <ul id="slides">
        {cf_hero_slideshow}
        <li>{cf_hero_slideshow:hero_slide_image}</li>
        {/cf_hero_slideshow}
        </ul>
      {/if}
    
    {/if}

     

  • #3 / Nov 02, 2013 12:29pm

    Andrew Barden

    2 posts

    Thank you! This is a good approach—my biggest question remains whether to set up one channel ‘Pages’ using Blueprints (or something to only show specific fields per-template), or whether to keep it as-is with each unique template being a channel.

  • #4 / Nov 02, 2013 1:53pm

    Rob Allen

    3118 posts

    No probs!

    It really depends how you want to structure your content (not referring to the Structure addon here!). There’s nothing wrong with having a “Pages” channel which works with a “pages” custom field group - if the site has very generic content then this sometimes covers most bases, you could then use categories to organise entries by type. Alternatively you could created several “pages” channels, eg About - pages, Service - pages all using the same custom field group if you wanted to have some sort of separation for publishing/editing purposes (or if you need to restrict certain content access per member (aka login) group).

    For outputting content to a template there are many options, a few examples:

    {!-- restrict entries to the 'about' channel --}
    {exp:channel:entries channel="about"}
    {title}
    {page_custom_field}
    {/exp:channel:entries}
    
    {!-- combine entries from 'about'  and 'sevices' channels --}
    {exp:channel:entries channel="about|sevices"}
    {title}
    {page_custom_field}
    {/exp:channel:entries}
    
    {!-- only show custom fields based on a URL segment from a template group and/or template, eg /about/company --}
    {exp:channel:entries channel="about|sevices"}
    
    {if channel_short_name == "services"}
      <h1>Services</h1>
    {/if}
    
    <h2>{title}</h2>
    <p> <br />
      {if segment_1 == "about"}<br />
        {page_custom_field_1}<br />
      {/if}<br />
     <br />
      {if segment_1 == "services"}<br />
        {page_custom_field_2}<br />
      {/if}</p>
    
    <p>     {page_custom_field_3}</p>
    
    <p>  {if segment_2 == "company"}<br />
        Our address blah…<br />
      {/if}  </p>
    
    <p>{/exp:channel:entries}

    As you can see there are numerous ways to manipulate content output and these examples only scratch the surface. It’s only when you start to play with EE do you discover the sheer amount of this you can do.

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

ExpressionEngine News!

#eecms, #events, #releases