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.

Defining Products

June 02, 2012 4:08pm

Subscribe [3]
  • #1 / Jun 02, 2012 4:08pm

    Abbas Jaffar Ali

    29 posts

    I’m currently running Wordpress for a tech news/reviews/blog website and trying EE to see if it’s a logical step up.

    One of the reasons for moving to a proper CMS is being able to define Product Categories (Phones, Tablets) each with a set of it’s own unique specifications and then being able to compare products within categories. For example, lets take the Phone category that may have specs like Screen Size, CPU Speed, Weight, Battery Life. I can then add products like iPhone 4S, HTC One X and Samsung Galaxy SIII.

    Now when I am reviewing the Samsung Galaxy SIII, I would like to be able to associate it with the Product as well as pull a table in the middle of a review that compares it to other products I’ve selected in the same category, for example, the iPhone 4S or the HTC One X.

    So my first question is- is the above possible and reasonably easy to implement in EE?

    Second, when defining products, do I use a single channel for all products or define separate channels for each category considering they’ll have vastly different fields/specs? Is there a plug-in/add-on that has already done any of this?

    Appreciate any help on this.

  • #2 / Jun 03, 2012 3:13am

    artminister

    159 posts

    Hi Abbas,

    Its easy to implement this in EE.

    My setup would be (Note: only 1 channel is necessary)

    Channel : Products (iPhone 4S, HTC One X and Samsung Galaxy SIII)
    Categories : phones, tablets
    Custom Fields: Screen Size, CPU Speed, Weight, Battery Life

    When you are reviewing a product, you can pull up the related products which belong to the same category using

    {exp:channel:entries channel="products" related_categories_mode="on" limit="10"}
     {if count == "1"}
       <h2>Related Products</h2>
    <p>  <ul><br />
     {/if}<br />
      <li><a href="http://{title_permalink=/products/view/}">{title}</a></li><br />
     {if count == total_results}<br />
       </ul><br />
     {/if}<br />
    {/exp:channel:entries}

    More information is here : http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#related-categories-mode

     

  • #3 / Jun 03, 2012 3:28am

    Abbas Jaffar Ali

    29 posts

    Thanks artminister-

    The problem is see with just one channel is that some products have completely different set of specs. So for example, a Mobile phone would have Screen size, CPU and battery life whereas a Hard Drive would have Form Factor, Capacity and Interface. If I just set up one Channel and try to add a product, won’t I see the specs of ALL products in one single page- most of which will be unneeded?

  • #4 / Jun 03, 2012 3:33am

    artminister

    159 posts

    Hi Abbas,

    Are you talking about the templates? If so, you can check if a custom_field is empty and display accordingly.

    If its the publish screen in the administration, I would not mind having unneeded fields. But if you think u need more than 1 channel, nothing stops you. Everything will work the same way.

  • #5 / Jun 03, 2012 3:57am

    Abbas Jaffar Ali

    29 posts

    Hi Abbas,

    Are you talking about the templates? If so, you can check if a custom_field is empty and display accordingly.

    If its the publish screen in the administration, I would not mind having unneeded fields. But if you think u need more than 1 channel, nothing stops you. Everything will work the same way.

    Yep- talking about the administration screen. I’ll probably have about 15 products types with each one having roughly 10 custom fields. This will make it a LOT of custom fields. I think what could have been nice is if you could specify multi field groups per channel. That way I could have used some specs that remain same across different products (think screen size that could be used in tablets and Smartphones) while have another group specific for products related to that channel.

  • #6 / Jun 03, 2012 10:52am

    John St-Amand

    865 posts

    Abbas - yes, there is a free add-on that will allow you to do this - it’s called “entry type”, written by Rob Sanchez.  It’s terrific. It lets you setup all the custom fields in the field group, then use the “entry type” field to set up each combination of fields you want for each purpose.  When the user selects the type of entry they are entering, the entry screen hides the fields that are not needed.  The only downside to this approach, really, is that you can’t customize the “required field” settings per entry type - you instead wind up having to make a lot of them NOT required in order for this approach to work - but it greatly simplifies your entry screen.  And then in your templates you have to write a bunch of conditionals matching each type of entry you’re creating.  If you use the excellent switchee addon, it doesn’t add any additional overhead to your template.

    Hope that helps.

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

ExpressionEngine News!

#eecms, #events, #releases