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.

When to use Channels?

November 12, 2012 5:03pm

Subscribe [2]
  • #1 / Nov 12, 2012 5:03pm

    99developer

    16 posts

    Hi, I’m new to EE and trying to learn channels. Some questions about Channels:

    Question 1:
    Are channels for “simple” data only (e.g. can be represented as a single table in the DB)? Or can it be used for data that requires complex relationships? For example:

    1. Entity-1 can have 0 or more Entity-2
    2. Entity-2 can have 0 or more Entity-3, Entity-4, Entity-5
    3. One of Entity-5’s columns is a lookup to Entity-6
    4. Enforce FK constraints, etc.

    When things get complicated like this, do I need to create my own module?

    Question 2:
    Also, what if I only needed a simple field to be populated by the admin (e.g. a “location” field), but needed to expand that entry into complete geocoded address and store that info? Can I use channels for that or not?

    Question 3:
    How to I implement custom validation for channel fields?

    Question 4:

    Is there a “blog” module I can download from EE? Or are those generally made via channels? I would assume things like this would become repetitive.

  • #2 / Nov 12, 2012 6:29pm

    Boyink!

    5011 posts

    Any time you need to store content that needs to be editable by non-programmers, use channels.

    Channels can have as many or few fields as you need to describe the content they hold.

    Adding a channel does not, at the EE database level, add new tables. It just extends existing tables.

    You can use categories or relationships to group content together.

    A blog would only require a channel with a few channel fields so no other module would be required (in fact in EE1 the channel module was called the weblog module which generally confused everyone).

    Validation would likely require the creating of a custom field type (field types are add-ons to allow for this).

    Channels can have some fields that are visible to certain member groups and not others using Publish Layouts.

  • #3 / Nov 12, 2012 7:21pm

    99developer

    16 posts

    What if the data requires complex relationships? Channels aren’t suited for that, right?

    Any comment on Question #2?

  • #4 / Nov 12, 2012 7:41pm

    Boyink!

    5011 posts

    Id suggest perusing devot-EE.com for the different field type addons.

  • #5 / Nov 12, 2012 7:47pm

    99developer

    16 posts

    So, if I needed a “location” field that takes a user input, geocodes it, then stores the geocoded address to a database—I need to use a field type addon?

  • #6 / Nov 14, 2012 4:32pm

    Dan Decker

    7338 posts

    Hi 99developer,

    EEdfw Geoplugin is free on Devot:ee and would make this really easy.

    Cheers,

  • #7 / Nov 14, 2012 4:41pm

    99developer

    16 posts

    Dan, I would probably prefer to use Google Maps API. In any case, this was just an example. The real question is how would I implement something like this on my own? Allow user to enter information in one field, then I explode that into more pieces of information and store it in the DB?

    Also, the BIG question is: can I define complex relationships using Channels? If it can, then I’m wondering why Playa exist (http://pixelandtonic.com/playa).

  • #8 / Nov 16, 2012 3:35pm

    Dan Decker

    7338 posts

    The real question is how would I implement something like this on my own? Allow user to enter information in one field, then I explode that into more pieces of information and store it in the DB?

    The easiest way to build that would be to create a custom ExpressionEngine Module. A module can process user forms and store that information in ExpressionEngine’s database.

    Also, the BIG question is: can I define complex relationships using Channels?

    ExpressionEngine include basic relationships and a many-to-one reverse relationship feature.

    ~

     

  • #9 / Nov 17, 2012 1:09am

    99developer

    16 posts

    Hi Dan, can you please elaborate on “many-to-one reverse relationship”? Does that equate to one-to-many? Or is it something completely different?

  • #10 / Nov 20, 2012 5:32pm

    Dan Decker

    7338 posts

    Hmmm…

    You can relate many entries to one other entry. The that one entry has access to all the templates that related to it via reverse related entries. It’s not one to many because the siblings have no knowledge of each other. Does that help clarify?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases