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.

Channel Logic Issue

January 30, 2012 2:24pm

Subscribe [3]
  • #1 / Jan 30, 2012 2:24pm

    Charming Nerd

    196 posts

    I am looking for some advice on how to solve a pretty big issue.

    Here is what is going on. On the following page we have a list of Trip Logs that users can view. Each one takes them to a login page. Each one has their own unique login. There is only one user pass that is created for each Trip Log. These are distributed to people via e-mail. Meaning, each user does not have a unique user / pass. That part really isn’t the issue. Take a look so you can get an idea.

    http://67.199.23.35/tripresources/triplogs.cfm


    Ideally each one of these would be it’s own channel. The problem and goal is - the admins need to be able to create new channels when they are needed. However, I don’t want them to have to edit template files but the channel entries tag needs a channel to be declared. In addition to that, there would need to be some if / then logic in place to only show a particular Trip Log to a particular Member or Member Group which would also require a template edit.


    I guess the first challenge would be to somehow make the channel= a variable and somehow let them choose it?

    I have also thought about making it 1 channel with categories. I still need to restrict access to each though. I also don’t like this option because it gives publishers access to all the Trip Log entries instead of just the trip they are working with and they could accidentally choose the wrong category.

    The other thing is that each one needs it’s own RSS feed.

     

  • #2 / Jan 30, 2012 5:06pm

    Andrew Fairlie

    126 posts

    You could split your channel logic into two channels:-

    1) Travel Log which has a few basic details such as an introduction as well as the login credentials
    2) A log entry which has a related field back to Travel Log

    That way you could have a Travel Log template group that would allow your staff to add as many logs as needed (and categorise them into Service Adventures, Language Adventures, Multisport Adventures or Gap Semesters) and also allow them to add new logs without ever entering a template. The template will load the reverse related entries for the log.

    Taking it further, if you used Playa over the standard Relationships field you could limit the entry list to only allow the admin to select from the Travel Logs they’re the author of. Of course there’s only 1 author per entry, so having multiple authors running the same log may need some tweaking.

    In my opinion if staff other than the web designer are editing templates, the system isn’t doing its job properly so I think you’re right to reconsider the way it’s working.

    A proper channel based method is the EE way, and would allow for RSS feeds as well as ultimate flexibility.

  • #3 / Jan 30, 2012 5:12pm

    Charming Nerd

    196 posts

    I don’t follow how that would be set up. Any chance you can walk me through how I would set it up? Using Playa is no problem if it makes things easier.

  • #4 / Jan 30, 2012 5:36pm

    Andrew Fairlie

    126 posts

    Yep not a problem.

    I presume you’re familiar with the templating structure of ExpressionEngine?

    From a channel perspective you would have something along the lines of:—

    + ch_log-collection
            -  title
            -  author 
            -  ch_log-collection_username
            -  ch_log-collection_password
            -  ch_log-collection_description
    
      + ch_log
            -  title
            -  author 
            -  ch_log_body
            -  ch_log_collection [assets related to the log collection]

    You could then have a template group like so:

    + triplogs
            -  index [html]
            -  log [html]

    The index file would be responsible for creating the equivilent of this page (which I presume currently isn’t EE):
    http://67.199.23.35/tripresources/triplogs.cfm

    Effectively there you would loop through each of the categories available to the ch_log-collection channel (Service Adventures, Language Adventures, Multisport Adventures or Gap Semesters) and then within each category display the channel entries within that category.

    A very rudimentary version would be.

    {exp:channel:categories category_group="1" channel="ch_log-collection"}
      <h1>{category_name}</h1>
      <ul>
        {exp:channel:entries channel="ch_log-collection" category_id="{category_id}"}
          <li><a href="/triplogs/log/{url_title}/">{title}</a></li>
        {/exp:channel:entries}
      </ul>
    {/exp:channel:categories}

    This would display a basic list like you have right now.

    For the Log template you would need some way to authenticate, which I don’t have time to go into right now I’m afraid but once you’re happy they’re logged in you would do something along the lines of this, which would load the entry for the Log Collection and then use Playa to load up all log entries related to that collection. To clarify: a collection is made up of logs - a log is put within a collection.

    {exp:channel:entries channel="ch_log-collection" limit="1" dynamic="yes"}
      <h1>{title}</h1>
      {exp:playa:parents channel="ch_log"}
        <h2>{title}</h2>
    <p>    </p><h3>By {author}</h3>
    <p>    {ch_log_body}<br />
      {/exp:playa:parents}<br />
    {/exp:channel:entries}

    I hope that helps you out at least a little bit. I think the solution works, but I’ve not tested any of the above and I’m making some pretty sweeping assumptions.

    Let me know!

  • #5 / Jan 30, 2012 5:51pm

    Charming Nerd

    196 posts

    Hmm. I am not sure you understand what I am after. Either that or I am confused. Probably the later.

    Let’s start with ch_log-collection. This would be the channel that my client would be allowed to create. There would be many of these. I need one for each trip. So the channel short names would end up being like so:

    africa_service
    costa_rica_service

    etc.

    Then we have a field group with these?

    -  title
    -  author
    -  ch_trip-logs_username
    -  ch_trip-logs_password
    -  ch_trip-logs_description


    How are you creating a username and password as field?

    I am really confused. Sorry.

  • #6 / Jan 31, 2012 4:05am

    Andrew Fairlie

    126 posts

    Are the fields between Africa Service and Costa Rica Service the same?

    It sounds like you may be confusing Channels with Entries?

    Your client would be able to add an entry within the c_log-collection channel. You wouldn’t have short channel names, but rather Entry IDs and URL Titles representing the specific log collection entries.

    Username and password / authentication in general you’d have to investigate but I’m sure there’s a plugin that would allow you to do it easily.

    Alternatively you could use the proper authentication methods in ExpressionEngine and hide the template and channel away to specific member groups?

  • #7 / Jan 31, 2012 11:30am

    Charming Nerd

    196 posts

    Okay, I am staring to understand a little. In a sense the ch_log-collection would be used to create ad hoc channels. The titles in that channel would actually be:

    Africa Service

    Australia / Fiji Service
    Costa Rica Service
    Ecuador / Galapagos Service
    Peru Service
    Thailand Elephant Service
    China/Tibet Service
    Spain/Morocco Service
    Hawaii Service
    Costa Rica Two-Week Service
    California Service
    Turkey / Greece Service
    Dominican Republic Service
    Africa Two-Week Service


    the ch_log-collection would also contain the categories:

    Service Adventures
    Language Adventures
    Multisport Adventures
    Gap Sememsters

    It would also allow them to create a user / pass on the publish page. This is a big x factor to me because there is a user / pass for each Trip. I don’t understand how I would authenticate without having to update the template, which is what I am trying to avoid. Authenticating with member groups is the same problem. If I created a member group for each trip I would have to update my template to accommodate it like so:

    {if logged_in_group_id == "3" OR logged_in_group_id == "4" OR logged_in_group_id == "5"}


    The ch_log would be used by Trip Leaders to publish the actual updates. The custom fields would look like this.

    Title
    Body
    Photo Gallery (Assets field.)

    And then you were saying that the trip log publish page would have the playa field so they could choose with Trip to put it in? So I am guessing that the Playa field would be populated by the title field of ch_log-collection.

    Then I would have to somehow display them on the template according to that playa field. Again it seems like the template would need to be updated.

    Then there is the RSS feed part. I need one for each trip. Will that work with only one channel?


    I do really like the idea of them creating the user/pass on a publish page. That would be really slick and user friendly.

     

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

ExpressionEngine News!

#eecms, #events, #releases