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.

Drop-Down Text

October 13, 2012 11:52am

Subscribe [2]
  • #1 / Oct 13, 2012 11:52am

    Phoenix First

    43 posts

    I am creating a new media center area on our website.. and the entries have a drop down what is a relationship with another channel so that i can assign an entry (video) to a series.  When I want a table on one of my pages to display the text from the drop down it displays a number instead.. how do i get it to display the text from the drop down instead of that number?

  • #2 / Oct 13, 2012 5:54pm

    PhilBrienesse

    187 posts

    can you post the code you are currently using? may help

  • #3 / Oct 13, 2012 6:10pm

    Phoenix First

    43 posts

    <h2>Recent Messages</h2>
    <p><div id="previously"><br />
    <table><br />
    <tr><th id="htitle">Title</th><th id="hdate">Date</th><th id="hpreacher">Teacher</th><th id="hseries">Series</th></tr><br />
    {exp:channel:entries channel="Service-Video" limit="20"}<br />
    <tr><br />
    <td><a href="http://www.phoenixfirst.org/media/video/{url_title}">{title}</a></td><br />
    <td>{entry_date format="%F %d, %Y"}</td><br />
    <td>{Speaker}</td><br />
    <td>{Sermon-Series}</td><br />
    </tr><br />
    {/exp:channel:entries}<br />
    </table></div></div></div>

    {Sermon-Series} is a drop down that currently displays a number to the right on the table at the bottom of this page.. http://www.phoenixfirst.org/media

  • #4 / Oct 14, 2012 2:04am

    PhilBrienesse

    187 posts

    If I am understanding you correctly then Sermon_Series is the related field. The only info that contains is the entry id of the related entry. You need to use the related entries tag to call up more info.

    http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html#related-entries-tag-pair

    Your code would look something like this.

    {exp:channel:entries channel="Service-Video" limit="20"}
    <tr>
    <td><a href="http://www.phoenixfirst.org/media/video/{url_title}">{title}</a></td>
    <td>{entry_date format="%F %d, %Y"}</td>
    <td>{Speaker}</td>
    <td>{related_entries id="Sermon_Series"}{title}(or whatever field you want to display){/related_entries}</td>
    </tr>
    {/exp:channel:entries}
  • #5 / Oct 14, 2012 9:01am

    Phoenix First

    43 posts

    Perfect.. that did what i needed..

    Only other thing I can’t figure out is how i can create a page that only displays content for one of the items in the drop down.  so that i they click on one of the series names it would display a page with the messages only from that series. I’d like for it to be dynamic if possible.

  • #6 / Oct 15, 2012 10:26am

    Phoenix First

    43 posts

    In the following code I would like to display entries based on the drop down menu for the series name.. I’m guessing this may not be possible and that I would need to use categories..

    I want to be able to display each series based on the url and have the images at the top of this page http://www.phoenixfirst.org/media (which are based on the entries for the series drop down) link dynamically to the page where it would sort out just the entries from that series..

    <div class="tabSection">
    {exp:channel:entries channel="Service-Video" limit="1" category="25"}
    <h2>Recent Messages From <strong>{related_entries id="Sermon-Series"}{title}{/related_entries}</strong></h2>
    <p>{/exp:channel:entries}<br />
    <div id="previously"><br />
    <table><br />
    <tr><th id="htitle">Title</th><th id="hdate">Date</th><th id="hpreacher">Teacher</th><th id="hseries">Series</th></tr><br />
    {exp:channel:entries channel="Service-Video" limit="20" category="25"}<br />
    <tr><br />
    <td><a href="http://www.phoenixfirst.org/media/video/{url_title}">{title}</a></td><br />
    <td>{entry_date format="%F %d, %Y"}</td><br />
    <td>{Speaker}</td><br />
    <td>{related_entries id="Sermon-Series"}{title}{/related_entries}</td><br />
    </tr><br />
    {/exp:channel:entries}<br />
    </table></div></div></div>

  • #7 / Oct 15, 2012 12:46pm

    Phoenix First

    43 posts

    I think I figured out that this would be easiest to accomplish using only categories and ditching the drop down.. No I’m just wondering how I would be able to display only the 2 most recent categories.. would i need to add a custom field to the category group to handle date?

  • #8 / Oct 15, 2012 5:52pm

    Robin Sowell

    13255 posts

    I’m a little fuzzy on how you have things set up.  Series and sessions, where a session is always in a single series.  And then display a series with all the sessions in that series- or a single session and link back to the session it’s in, all that should be pretty easy with relationships.

    And now on the media page (http://www.phoenixfirst.org/media) that bit is working, but the problem is how to show the two most recent session entries- and the two should not be in the same series. 

    If that’s the case… there isn’t a great way to use categories here.  There isn’t a tag for showing categories ordered by the most recent entry in the category, which is what it sounds like you would need. 

    If I understand everything, I think you might need either a custom add-on or a little creative embed/nesting.  So to get the very latest entry in sessions, just use a tag limited to that channel and a limit of 1.  That works no problem- yes?  IF that works no problem- you could pass the id of the related entry as an embed variable, and then use it in a custom query that figure out the latest session entry that is NOT related to that series.  But like I say- it would be a custom query.

    I don’t love either of those.  I’d be tempted to write an extension that maybe updates a custom field in a channel whenever something is related to that channel.  Then I could just use a channel tag- show the series channel, order by that field, and limit to 2.

    But short answer- I’m not thinking of a totally out of the box solution.  Did the brainstorming give you some ideas, though?

  • #9 / Oct 15, 2012 6:04pm

    Phoenix First

    43 posts

    Well.. I need to accomplish 4 pages..

    1. The page that is already located at http://www.phoenixfirst.org/media

    2. A Page that displays series artwork with a list styled as on the media page but only displays the entries that are part of the series they clicked on from page 1.

    3. The page that displays the video with it’s info they selected in the list on page 2.

    4. This page is basically created.. http://www.phoenixfirst.org/media/archive.. that just displays a list of all the entries with not date limits so our viewers can go back and find an old video if they want.

    As of right now.. I have a channel to enter the series info.. Then a Channel for the actual videos (which has a relationship field to make each video a part of a series).. And I have entered a pretty fair amount of data and everything seems pretty functional to this point.. I just have hit a road block in figuring out how to list entries based on that field that relates to the series channel.

  • #10 / Oct 16, 2012 5:51pm

    Robin Sowell

    13255 posts

    So:

    1. http://www.phoenixfirst.org/media [works fine]
    2. Do you have a test page?  You would get there clicking on ‘Preparing To Win’ for example.  Looks just like http://www.phoenixfirst.org/media but displays only preparing to win stuff.  So- can’t you just have a relationship field for the class, and you relate it to the series.  And on this page, just show reverse related entries from the ‘class’ channel.

    Let’s get 2 working- then go to next part.  Does that work- or what am I missing?

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

ExpressionEngine News!

#eecms, #events, #releases