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.

I need some assistance converting a CodeIgniter app to EE

July 18, 2012 1:15am

Subscribe [2]
  • #1 / Jul 18, 2012 1:15am

    jaydisc

    19 posts

    I have a CodeIgniter app that provides premium content to customers and I would like to fold it into my company’s EE website and build a commerce system around it there. I’ve already purchased Profile:Edit and intend to purchase CartThrob shortly, and I have come up with strategies to hide, and require payment for the content, but I just haven’t figured out the best way to load the actual content into EE itself.

    At the moment, the CI app has URLs like this:

    <a href="http://example.com/program/{program_name}/{sub">http://example.com/program/{program_name}/{sub</a> content}/{related content}/{etc}

    I then have CI “routes” that send those Segment to the relevant functions:

    $route['program/([^/]+)/(phase(:num))?/?unit(:num)'] = 'controller/function/$1/$4/$3';

    I’d really like to maintain this very logical, easy-to-read URL scheme, but I’m not sure where to begin with something like that in EE. I obviously need to get the content into Channels and use Relationships. I’ve created a Template Group named “program” with just index. I was thinking of just having index call an Add-On which would parse all of the segments, and have its own views it could server up as needed, but I really want to keep all of the program content, sub content and related content in Channels so my production team can happily edit and extend the product without coding or delving into phpMyAdmin.

    Can anyone give me a nudge in the right direction? I’m very familiar with CodeIgniter, mildly familiar with EE, and I have already written some of my own EE modules.

    Thanks

  • #2 / Jul 18, 2012 1:25am

    jaydisc

    19 posts

    Maybe I can clarify this further.

    Programs

    I expect to have a program channel and I’d like the title to be the trigger for getting to that Program’s home page. So, let’s say an entry in that channel has a title of my-program. So, ideally this URL would load that: example.com/program/my-program. Similarly, example.com/program/my-other-program would load the same template but grab the Program channel entry with the title my-program. This part is easy. I’m pretty I can do that quite easily.

    Chapters

    Next, each Program has Chapters. Ideally, I’d like to have these two URLs load DIFFERENT content:

    example.com/program/my-program/chapter1
    example.com/program/my-other-program/chapter1

    It would do this by assessing the Program segment of the URL (my-program vs. my-other-program), and ideally a relationship from that, to load the correctly related “chapter1” related to THAT Program.

    And ideally it could go a few more tiers down the line like that.

    Possible?

  • #3 / Aug 08, 2012 7:56am

    Travis Kohn

    18 posts

    This is something that I too would like to find out. I’m also very green in respects to EE but have a considerable amount of CI experience.

    From what I gather, EE URL segments are routed to Template groups and templates. Correct?

    So your URL of “program/chapter_1” would actually render a page using the “program” template group and template “chapter_1” from within that group. Correct?

    Wouldn’t the 3rd segment be the “URL Title” of the channel entry? The actual content?

    So maybe you would need to create a template group for your programs named “programs”, an index template to list the available programs a “program” template for individual programs and then a template named “chapter” to display the chapter specific content (for any chapter)... and then your URLs would look like:

    domain.com/programs/program/the-first-program
    domain.com/programs/program/the-second-program

    and

    domain.com/programs/chapter/p1c1-first-chapter-of-program-1
    domain.com/programs/chapter/p1c2-second-chapter-of-program-1
    domain.com/programs/chapter/p2c1-first-chapter-of-program-2
    etc…

    You could then create your channel and connect it to the “programs” template group and use that to load up your content.

    Am I on the right track or did I only make this problem worse? Sorry if I did, not very experienced with EE yet.

    Cheers,
    Pete.

  • #4 / Aug 08, 2012 8:07am

    Travis Kohn

    18 posts

    Just remembered something, your template group’s index template doesn’t have to be a listing of items. You can make it anything you want, including a display template for a specific program.

    domain.com/programs/my-first-program

    but I still don’t know how to get the chapter nested below it… sorry. I am assuming it has to do with custom routing (if it’s possible at all) but we’ll have to wait until a more proficient EE user uncovers the answer.

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

ExpressionEngine News!

#eecms, #events, #releases