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.

Unable to filter by Year

October 29, 2010 11:12pm

Subscribe [3]
  • #1 / Oct 29, 2010 11:12pm

    Nicolas E

    44 posts

    Hello guys!

    We have an event that takes place once a year on about 4-5 cities.
    So, we have a main page to display the years that the event has taken place in:
    http://198.65.234.138/index.php

    There you pick the year you want to review and it will display the cities were the event took place that year.
    Here for example the one after you select the year 2010:
    http://198.65.234.138/index.php/home/detalle/encuentro_2010

    Our problem is that this page is displaying 8 events (5 for 2010, 1 for 2007, 1 for 2008 and 1 for 2009)
    We want this to display ONLY the events/cities that took place for the chosen year.

    Our current channels are:
    encuentros - Like editions only with title (Currently, 2007, 2008, 2009 and 2010)
    eventos - Like events with more fields, but of importance: Name, Ciudad (City) with relationship to ciudades:title, Encuentro (Edition) with relationship to encuentro:title.

    This is the code we currently have to display the events/cities for the specific year, which show ALL events:

    {exp:channel:entries channel="eventos" dynamic="no" limit="10"}    
                            <li>
                                <a href="#">{thumbnail}</a>
                                {related_entries id="ciudad"}
                                <h2><a href="#">{title}</a></h2>
    <p>                            {/related_entries}<br />
                                <span class="square"></span>{fecha}<br />
                            </li><br />
                        {/exp:channel:entries}

    When we switch dynamic=“on” all events disappear.

    Your help with this issue WITHOUT the use of third party plugins is greatly appreciated,
    Best,

    Nicolas E.

  • #2 / Oct 31, 2010 5:03pm

    Greg Salt

    3988 posts

    Hi Nicolas,

    The dynamic=“no” parameter is definitely not what you want to use in this scenario because as the documentation states anything in the URL will be ignored. Have you looked at the year parameter?

    Cheers

    Greg

  • #3 / Dec 17, 2010 12:05am

    Nicolas E

    44 posts

    Greg,

    Thanks, we solved this with a reverse related entries implementation,

    Best,

    Nicolas E.

  • #4 / Dec 17, 2010 11:31am

    Ingmar

    29245 posts

    Very good. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases