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.

Real world example

March 18, 2010 12:41am

Subscribe [4]
  • #1 / Mar 18, 2010 12:41am

    khomel

    9 posts

    I’ve been evaluating EE for a while now and I’m sold. However, I don’t have a lot of programming experience in it yet. Coming from ColdFusion/PHP custom development, I tend to do sites with functionality like on this site, for example:
    http://favorednations.com/

    That’s not my site, but I was surfing it today and I wondered how I would do a site like that in EE, specifically the artists and tours sections.

    In CF/PHP, I would just use a template and pass in URL vars for the correct database entry. But in EE, I’m a bit confused.

    Would you guys suggest, for both sections, entries in weblogs? Then just dump the titles (which could be the tour/artist names) into a select element then write a javascript function to forward the users onto the correct permalink? Or is there a better way to do it? Obviously I could make templates for each one, but who wants to keep all that updated?

    Or, is something like this better suited as a custom site, not built with EE?

    Thanks for any feedback!

  • #2 / Mar 18, 2010 2:20am

    Focus Lab Dev Team

    1129 posts

    Hey khomel. I think you might find great value in this blog series from Lisa on the EllisLab team. It talks about how EE utilizes the URL and really helps draw a picture on how to do some things out of the box. Check out each article and let me know if it helps point you in the right direction 😊

    http://expressionengine.com/blog/article_list/category/importance_of_semantics/

  • #3 / Mar 18, 2010 3:58am

    khomel

    9 posts

    Thanks for the link to the series! Although that is a great article series, it doesn’t really help with what I was asking about. I’m pretty comfortable at this point with how the URL strings work in EE, but I’m really looking for suggestions on how best to create those types of sections I mentioned.

    I think the artist section would be fine as weblog entries. Just a “non-standard” way of displaying the links. Although the subpages might be difficult. Can’t quite wrap my head around that yet.

    However, the tour section… Would I be better off posting tour dates as entries and setting their categories with city and state, or better to use the query module (or something like it) for retrieving that data? Maybe something like this is where playa comes in. Haven’t figured that out yet.

    The light bulb has not gone off yet, but I’m confident it will soon enough. Thanks again for the link!

  • #4 / Mar 18, 2010 7:11am

    e-man

    1816 posts

    In CF/PHP, I would just use a template and pass in URL vars for the correct database entry. But in EE, I’m a bit confused.

    In EE’s terms, those URL vars would be URL segments.
    http://expressionengine.com/docs/templates/globals/url_segments.html

    Would you guys suggest, for both sections, entries in weblogs? Then just dump the titles (which could be the tour/artist names) into a select element then write a javascript function to forward the users onto the correct permalink? Or is there a better way to do it? Obviously I could make templates for each one, but who wants to keep all that updated?

    Or, is something like this better suited as a custom site, not built with EE?

    Thanks for any feedback!

    Lots of ways of doing this, have a look at dynamic parameters:
    http://expressionengine.com/docs/modules/weblog/dynamic_parameters.html

    Or, if you’re more comfortable going straight to php why not check out the CodeIgniter framework?
    http://ellislab.com/codeigniter/user-guide/

  • #5 / Mar 18, 2010 9:15am

    khomel

    9 posts

    OK, I’ll keep looking and trying different things. I guess I’m just looking for a best practices sort of thing. Trying to do it the “EE way” vs. what I’m used to (which would be setting up tables in the db, then joining them together as necessary at runtime).

  • #6 / Mar 18, 2010 9:50am

    Focus Lab Dev Team

    1129 posts

    Okay, I think I have a better idea of what you’re looking for now.

    I would suggest setting up an Artists weblog where each artist has their own entry and you have a specific template for that page.

    I would then have a Tour weblog where each date is a single entry. One of your custom fields would be a Relationship field which would tie the tour date to the artist (followed by fields for city, state, venue, date, and notes). Then to search by artist you could just use the artist url_title and use the reverse_related_entries tag to pull in the dates. You can use the dynamic parameters as well (especially for city/state) that Erwin linked to above.

    I would personally consider that the “EE way” to me 😊

  • #7 / Mar 18, 2010 11:43am

    khomel

    9 posts

    Very cool! That tag name led me to this post:
    http://ellislab.com/blog/entry/behind_the_curtain_part_four/

    Which was very helpful. Starting to click… thanks for your help!

  • #8 / Mar 18, 2010 11:46am

    Focus Lab Dev Team

    1129 posts

    Awesome! Glad to help 😊

  • #9 / Mar 18, 2010 12:06pm

    khomel

    9 posts

    OK, one more thing. Relationships and reverse related make perfect sense. But I’m trying to wrap my head around the search by city/state.

    Let’s say my entry for my tour_dates weblog has the date, the city, the state, the venue (from the venue weblog), the performance time, and the related artist (from the artist weblog). Easy to display the data for artists or tour dates and join them. But how would I search by city? Can this be done without the query module?

    Basically I’m trying to say:

    SELECT *
    FROM tour_dates
    WHERE city = ‘myCity’

    (but with the joins for venue and artist, of course)

    I didn’t see a way to do this with dynamic variables…maybe I’m misunderstanding one of the parameters that will allow for this.

    Perhaps it can be done with an if statement to see if the city field = myCity, but that seems inefficient to grab the entire query instead of only the dates in a certain city.

    Thanks again for your help.

  • #10 / Mar 18, 2010 2:07pm

    Focus Lab Dev Team

    1129 posts

    I would use URL segments with the search parameter.

    http://expressionengine.com/docs/modules/weblog/parameters.html#par_search

    So if your URL was http://yoursite.com/tours/ga/ you could have a weblog entries tag that looked similar to this:

    {exp:weblog:entries weblog="tours" search:state="={segment_2}"}
  • #11 / Mar 18, 2010 2:14pm

    khomel

    9 posts

    search:field_name=

    Ah! I get it. With the segment parameter, that makes perfect sense. Thanks again!

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

ExpressionEngine News!

#eecms, #events, #releases