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.

Conditional navigation

July 21, 2011 2:40pm

Subscribe [2]
  • #1 / Jul 21, 2011 2:40pm

    Chriiiiso

    46 posts

    I’ve been looking around at navigation add-ons, but figured I’d ask the experts.

    We have a need for navigation to change based on if something has been sold or not.  For example: http://www.classiccountryland.com/

    In the left navigation, you can see properties have have sold are in the “Success Stories” sub-category of the state drop down.  Right now we have to manually update that.

    It would be amazing if EE could see the “status” of a property (sold or available), and the menu automatically update.

    Thanks for your time.

  • #2 / Jul 21, 2011 8:24pm

    Leslie Camacho

    1340 posts

    I’ve been looking around at navigation add-ons, but figured I’d ask the experts.

    We have a need for navigation to change based on if something has been sold or not.  For example: http://www.classiccountryland.com/

    In the left navigation, you can see properties have have sold are in the “Success Stories” sub-category of the state drop down.  Right now we have to manually update that.

    It would be amazing if EE could see the “status” of a property (sold or available), and the menu automatically update.

    Thanks for your time.

    There is likely a way to do this out of the box (probably more than one).

    The most straight forward way is to create a Custom Status of “sold”. Then in your nav code specify that only entries with sold are listed. Assuming the properties are categorized by state, it might look something like this.

    If California has a Category ID of 3, the below would list all entries in the California category that have a custom status of sold. This means when you switch a property’s Status to “sold”, the nav would automatically update to include the new sold property.

    {exp:channel:entries channel="properties" category="3" status="sold"}
    <li><a >{Title}</a></li>
    {/exp:channel:entries}

    An alternative would be to create a “sold” category. When a home is sold, you’d add it to the “sold” category. In your navigation code you’d then setup the success stories to list entries from the properties Channel, but limit it to entries that are in the appropriate state and have the sold category.

    So, as an example if California has a Category ID of 3 and “sold” has a Category ID of 45 the following would dynamically list only entries that are both in the California category and the Sold category. Note that the “&” is what enables this. This makes the dynamic category listing inclusive, meaning the entry has to be match both categories in order to be listed. Using 3|45 would list all entries from both categories, not just entries that matched both.

    {exp:channel:entries channel="properties" category="category="3&45;"}
    <li><a >{Title}</a></li>
    {/exp:channel:entries}
  • #3 / Jul 22, 2011 11:45am

    Chriiiiso

    46 posts

    Thanks for the reply, was really helpful.  I think the custom status would be the most intuitive for co-workers to understand.

  • #4 / Jul 22, 2011 2:39pm

    Leslie Camacho

    1340 posts

    Glad I could help you out!

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

ExpressionEngine News!

#eecms, #events, #releases