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.

MP3 Weblog Call ("If" Statement Goes to Next Newest Post if No MP3 File Present)

October 05, 2007 6:10pm

Subscribe [1]
  • #1 / Oct 05, 2007 6:10pm

    Knuckle007

    6 posts

    EE Forum,

    I am Using Expression Engine v.1.6 (Full/Not Core) on a Non-Profit License.

    THE GOAL: I am going to link to last week’s sermon/message on the front page of our church website, and have a single MP3 dynamically (from a “weblog” entry) play in a Flash MP3 player.

    Sometimes in our sermon/message “weblog” we would like to occasionally mention messages that are coming up and don’t have an MP3 file connected to the “weblog” entry.  This is where my problems begin. Meaning, we could have 1st, 2nd, or 3rd latest entries that MAY NOT have a MP3 file YET in the MP3 template field.

    If we choose the latest weblog “MP3” entry from the “weblog”, and it doesn’t have an mp3 file connected to it, how can we [with conditions] tell the player the following:

    1. Skip it, then,
    2. Play the most recent “weblog” entry (sorted by date) that HAS a “weblog” entry that doesn’t have the “MP3” template entry field as empty.

    I don’t want to create [ideally] another feed separate from our podcast feed (so this would be a double-win).

    I’m not that great at PHP/EE conditionals, so I’d appreciate ANY input on some options on what I want to accomplish. Thanks in advance.

    Knuckle007

  • #2 / Oct 12, 2007 4:47pm

    Lisa Wess

    20502 posts

    Hi, Knuckle007—

    I’m having some trouble following what you want to do here, which may be why you have not received many responses.

    Are you saying that you want to limit to entries that have the MP3 field filled out?  Or you want to show a special message if there is not yet an MP3?  If you can clarify on your intent, that would help a great deal.

    Thanks =)

  • #3 / Oct 12, 2007 7:40pm

    Knuckle007

    6 posts

    Hi, Knuckle007—

    I’m having some trouble following what you want to do here, which may be why you have not received many responses.

    Are you saying that you want to limit to entries that have the MP3 field filled out?  Or you want to show a special message if there is not yet an MP3?  If you can clarify on your intent, that would help a great deal.

    Thanks =)

    Clarity .... what a novel idea!

    1. Limit it to entries that have the MP3 field filled out.

    2. No notifications needed for missing MP3 entry, just to skip it for the next weblog entry that has the field filled.

    3. Nothing fancier than this, other than the technique being able to port to an RSS Podcast feed for iTunes/Feedburner.

    Thanks again!

  • #4 / Oct 12, 2007 7:47pm

    Lisa Wess

    20502 posts

    Have a look in the extensions forum for custom fields in {exp:weblog:entries} by Mark Huot; that’ll do what you want.  Alternatively, you could use a custom status for this, but it would be another step.

  • #5 / Oct 12, 2007 8:46pm

    Knuckle007

    6 posts

    SOLVED:

    As of November 13th, 2007, and ExpressionEngine Version 1.6.1, there is the NATIVE ability to include entries based on search terms in a weblog.

    ExpressionEngine Documents Link: SEARCH LINK

    search:field_name=

    The “search:” parameter allows you to constrain Weblog Entries output based on content within your custom fields. You specify which field to search by using the field’s short name immediately after “search:”. You can search based on whether a field is an exact match to your provided term or whether or not a field simply contains your term.

    NOTE: Only custom fields of the type “Text Input”, “Textarea”, and “Drop-down Lists” are searched with this parameter.

    Examples:

    search:body="=pickles|shoes"
    search:body="=not pickles|shoes"
    search:body="pickles|shoes"
    search:body="not pickles|shoes"
    search:body="pickles&&shoes;"
    search:body="not pickles&&shoes;"
    search:body="cat\\W"
    search:body="IS_EMPTY"
    search:body="not IS_EMPTY" [[[[[[ KEY ENTRY WE ARE LOOKING FOR ]]]]]]
    search:body="=IS_EMPTY|sandwich"
    search:body="IS_EMPTY|sandwich"
    search:body="not IS_EMPTY|sandwich|salad"

    How I Used It in the Podcast Feed:

    {exp:rss:feed weblog="audio-messages"}
    .....
    {exp:weblog:entries weblog="audio-messages" search:audio_file="not IS_EMPTY"}
    .....
    {/exp:rss:feed}
  • #6 / Oct 12, 2007 8:57pm

    Lisa Wess

    20502 posts

    Yes, I know you use custom fields; the only way to not use custom fields is to use only the title *grins* - did you read about that extension? It does exactly what you need - let’s you limit by the contents of a custom field. =)

  • #7 / Oct 13, 2007 2:28pm

    Knuckle007

    6 posts

    SOLVED:

    GO TO THIS FORUM ENTRY: FORUM ENTRY

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

ExpressionEngine News!

#eecms, #events, #releases