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.

Sorting

June 05, 2012 11:35pm

Subscribe [3]
  • #1 / Jun 05, 2012 11:35pm

    Phoenix First

    43 posts

    I am trying to sort entries ascending by date..

    when I tell it to order by date the entries show but aren’t in any order..

    then tell it to sort ascending by date they disappear

    Here is the code.. I am referring to the code near the bottom under “Speaking Engagements”

    <?php
    
    /////////////////////////////
    // Page variables
    ////////////////////////////
    $pagerLocation = '{site_url}design/';
    $cycleImages = '{site_url}design/';
    $sidebarType = 'Left';  // Left, Right, None (case sensitive)
    if($sidebarType == 'None') { $noSidebar = $sidebarType; } else { $noSidebar = ''; }
    unset($sidebarIncludes[1]);
    $sidebarIncludes[2] = 'email';
    $sidebarIncludes[4] = 'backtolist';
    $sidebarIncludes[5] = 'pastors';
    ?>
    
    {exp:channel:entries channel="profile" status="Approved" entry_id="769" show_future_entries="yes" limit="1"}
    
    <?
    /////////////////////////////////////////////////////////////
    // START CONTENT HERE
    ///////////////////////////////////////////////////////////////////////////////
    ?>
    
    {embed=includes/doc-start-1 page_name="Phoenix First \\\\\\\\ {title}" page_description="" page_keywords=""}
    
    <? //////////////////////////////////
    // CUSTOM STYLES AND SCRIPTS
    ////////////////////////////////// ?>
    <style type="text/css">
    
    {embed=styles/new-profile-detail}
    {if field_id_117 != ''}
    #headerBg{width:100%; background:url({field_id_117}) center bottom no-repeat;}
    .fixed { overflow:hidden; height:{field_id_118}px; padding:0; margin:0; width:100%; background:none;  }
    {/if}
    
    </style>
    
    {embed=includes/doc-start-2}
    
    {embed=includes/nav}
    
    {embed=includes/header-start}
    
     <div class="fixed">
      <a href="http://{facebook}%22id=%22content%22&gt&lt/a&gt&lth1{if" class="textHidden">[url=http://www.phoenixfirst.org/design/icons/facebookicon.png{if:else}<a]http://www.phoenixfirst.org/design/icons/facebookicon.png{if:else}<a</a> href="#">{/if}[/url]</span>
    {if twitter != ''}<span class="profileSocial"><a href="http://twitter.com/{twitter}">http://www.phoenixfirst.org/design/icons/twittericon.png{if:else}<a href="#">{/if}</a></span>
    {if field_id_125 != ''}<span><a href="http://{field_id_125}">http://www.phoenixfirst.org/design/icons/storeicon.png{if:else}<a href="#">{/if}</a></span></h3>
    <p>602-867-7117 ext. {field_id_3} • <a href="mailto:{field_id_5}">Email {field_id_1} {field_id_7}</a></div>                                    <br />
                              </p><h3>ABOUT {field_id_1} {field_id_7}</h3>
    <p><div class="profileBio">{biography}</div><br />
    </div><br />
                                  <br />
    {/exp:channel:entries}</p>
    
    <p><div class="tbCol2"><br />
    <div class="profileinfo"></p>
    
    <h2>Speaking Engagements</h2>
    <p>                              <br />
    {exp:channel:entries channel_id="29" limit="5" status="Approved" show_future_entries="yes" orderby=”date” sort="asc"}<br />
    {if field_id_158}{field_id_158}</p>
    
    <p><strong>{field_id_159}</strong></p>
    
    <p>{field_id_160}</p>
    
    <p>{/if}<br />
    {/exp:channel:entries}<br />
                                 <br />
    </div></div></div></div></div></p>
    
    <p>{!-- CONTENT ENDS HERE ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --}</p>
    
    <p>    </div><br />
                    <div class="contentDivs<?=$sidebarType;?>" id="contentSidebar<?=$noSidebar;?>"><br />
         <div class="sidebarTopPadding"></div></p>
    
    <p><br />
    {!-- ////////////////////////////////<br />
    // EMBED THE MINISTRY NAVIGATION, ETC<br />
    ///////////////////////////////////// --}</p>
    
    <p><?<br />
    if($sidebarType != 'None') {<br />
        foreach($sidebarIncludes as $include) {<br />
            echo '{embed=sidebar/'.$include.' sidebarType="'.$sidebarType.'"}';<br />
        }<br />
    }<br />
    ?></p>
    
    <p></div><br />
    <div class="clear"></div></p>
    
    <p><br />
    {!-- SIDEBARS END HERE //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --}<br />
                    </p>
    
    <p>{embed=includes/content-end}    </p>
    
    <p>{embed=includes/footer}</p>
    
    <p>{embed=includes/doc-end}

  • #2 / Jun 06, 2012 1:45am

    Manoj Thomas

    185 posts

    Maybe try fixing the quotes around the date parameter?

    {exp:channel:entries channel_id="29" limit="5" status="Approved" show_future_entries="yes" orderby=”date” sort="asc"}
    {if field_id_158}{field_id_158}
    
    {exp:channel:entries channel_id="29" limit="5" status="Approved" show_future_entries="yes" orderby="date" sort="asc"}
    {if field_id_158}{field_id_158}
    

     

  • #3 / Jun 06, 2012 1:53am

    Phoenix First

    43 posts

    Nope.. Still Got Nothin’

  • #4 / Jun 06, 2012 10:56am

    Phoenix First

    43 posts

    Entries are currently showing after removing the sort tag but leaving orderby=“date”

    http://www.phoenixfirst.org/about-us/tommy-barnett

    As soon as i add the sort=“asc” everything disappears if i change it to “desc” everything shows

  • #5 / Jun 07, 2012 10:56am

    Dan Decker

    7338 posts

    Hi Phoenix First,

    It is often overlooked, but I think you just need to add dynamic=“off” and you’ll be all set.

    {exp:channel:entries channel_id="29" limit="5" status="Approved" show_future_entries="yes" orderby=”date” sort="asc" dynamic="off"}

    Cheers,

  • #6 / Jun 07, 2012 12:12pm

    Phoenix First

    43 posts

    Still Got Nothin…

  • #7 / Jun 11, 2012 10:24am

    Phoenix First

    43 posts

    No Solution for this yet.. Any help would be greatly appreciated.

  • #8 / Jun 12, 2012 11:47am

    Shane Eckert

    7174 posts

    Hello Phoenix First,

    What version of ExpressionEngine are you currently running?

    Can you try this? Let’s start with just a few options.

    {exp:channel:entries channel_id="29" orderby=”date” sort="asc" dynamic="off"}

    Please let me know.

    Cheers,

  • #9 / Jun 12, 2012 11:58am

    Phoenix First

    43 posts

    We are on Version 2.4.0

    Still have nothing after making that change.

    ...

  • #10 / Jun 12, 2012 12:08pm

    Shane Eckert

    7174 posts

    Hey Phoenix First,

    channel_id= is not a valid channel entries tag pair parameter. Can you use channel=“shortname”?

    Thank you,

  • #11 / Jun 12, 2012 12:11pm

    Phoenix First

    43 posts

    Nothing

  • #12 / Jun 13, 2012 4:10pm

    Shane Eckert

    7174 posts

    Hey Phoenix First,

    Can you please give me a little more information when you reply? The short sentences and one word answers are slowing things down a bit. I want to be as effective as possible in solving your issue. Maybe tell me a bit about about what you are seeing and what kinds of output the site is giving you. What does the tag look like at this point, etc.

    Okay, so did you literally use channel=“shortname” or did you replace shortname with the shortname of the channel?

    Thank you,

  • #13 / Jun 19, 2012 10:58am

    Phoenix First

    43 posts

    I Know i can’t put “Channel=Shortname”

    Here is the code as it is right now…

    <?php
    
    /////////////////////////////
    // Page variables
    ////////////////////////////
    $pagerLocation = '{site_url}design/';
    $cycleImages = '{site_url}design/';
    $sidebarType = 'Left';  // Left, Right, None (case sensitive)
    if($sidebarType == 'None') { $noSidebar = $sidebarType; } else { $noSidebar = ''; }
    
    $sidebarIncludes[2] = 'email';
    $sidebarIncludes[4] = 'backtolist';
    $sidebarIncludes[5] = 'pastors';
    ?>
    
    
    {exp:channel:entries channel="profile" status="Approved" entry_id="769" show_future_entries="yes" limit="1"}
    
    
    
    <?
    /////////////////////////////////////////////////////////////
    // START CONTENT HERE
    ///////////////////////////////////////////////////////////////////////////////
    ?>
    
    {embed=includes/doc-start-1 page_name="Phoenix First \\\\\\\\ {title}" page_description="" page_keywords=""}
    
    <? //////////////////////////////////
    // CUSTOM STYLES AND SCRIPTS
    ////////////////////////////////// ?>
    <style type="text/css">
    
    {embed=styles/new-profile-detail}
    {if field_id_117 != ''}
    #headerBg{width:100%; background:url({field_id_117}) center bottom no-repeat;}
    .fixed { overflow:hidden; height:{field_id_118}px; padding:0; margin:0; width:100%; background:none;  }
    {/if}
    
    </style>
    
    {embed=includes/doc-start-2}
    
    {embed=includes/nav}
    
    {embed=includes/header-start}
    
     <div class="fixed">
      <a href="http://{facebook}%22id=%22content%22&gt&lt/a&gt&lth1{if" class="textHidden">[url=http://www.phoenixfirst.org/design/icons/facebookicon.png{if:else}<a]http://www.phoenixfirst.org/design/icons/facebookicon.png{if:else}<a</a> href="#">{/if}[/url]</span>
    {if twitter != ''}<span class="profileSocial"><a href="http://twitter.com/{twitter}">http://www.phoenixfirst.org/design/icons/twittericon.png{if:else}<a href="#">{/if}</a></span>
    {if field_id_125 != ''}<span><a href="http://{field_id_125}">http://www.phoenixfirst.org/design/icons/storeicon.png{if:else}<a href="#">{/if}</a></span></h3>
    <p>602-867-7117 ext. {field_id_3} • <a href="mailto:{field_id_5}">Email {field_id_1} {field_id_7}</a></div>                                    </p><h3>ABOUT {field_id_1} {field_id_7}</h3>
    <p><div class="profileBio">{biography}</div></div><br />
    {/exp:channel:entries}</p>
    
    <p><br />
                                  <div class="tbCol2"><br />
                                  <br />
                                  <div class="tbspeaking"><br />
                                  <br />
                                  </p><h2>Speaking Engagements</h2>
    <p>                              <br />
    {exp:channel:entries channel="tb_speaking_engagement" orderby="date" sort="asc" dynamic="off"}<br />
    {if field_id_158}<date>{field_id_158}</date></p>
    
    <p><church>{field_id_159}</church></p>
    
    <p>{field_id_160}</pastor></p>
    
    <p>{if field_id_161}<a href="http://{field_id_161}">More Info >>></a><br />
    {/if}</p>
    
    <p>{/if}<br />
    {/exp:channel:entries}<br />
    </div></div></div></div></div></p>
    
    <p>{!-- CONTENT ENDS HERE ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --}</p>
    
    <p>    </div><br />
                    <div class="contentDivs<?=$sidebarType;?>" id="contentSidebar<?=$noSidebar;?>"><br />
         <div class="sidebarTopPadding"></div></p>
    
    <p><br />
    {!-- ////////////////////////////////<br />
    // EMBED THE MINISTRY NAVIGATION, ETC<br />
    ///////////////////////////////////// --}</p>
    
    <p><?<br />
    if($sidebarType != 'None') {<br />
        foreach($sidebarIncludes as $include) {<br />
            echo '{embed=sidebar/'.$include.' sidebarType="'.$sidebarType.'"}';<br />
        }<br />
    }<br />
    ?></p>
    
    <p><br />
        </div><br />
                    <div class="clear"></div></p>
    
    <p><br />
    {!-- SIDEBARS END HERE //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --}<br />
                    </p>
    
    <p>{embed=includes/content-end}    </p>
    
    <p>{embed=includes/footer}</p>
    
    <p>{embed=includes/doc-end}

  • #14 / Jun 20, 2012 10:47am

    Phoenix First

    43 posts

    Would it make any sense if i added a custom field for the date and tried to sort from that? rather than sorting by the entry date?

  • #15 / Jun 20, 2012 11:20am

    Phoenix First

    43 posts

    I changed the entries so that their entry date was yesterday and the expiration date of the entry is the date of the actual event.. so now its sorting by the expiration date.. still not working..

    Here is the current code…

    <?php
    
    /////////////////////////////
    // Page variables
    ////////////////////////////
    $pagerLocation = '{site_url}design/';
    $cycleImages = '{site_url}design/';
    $sidebarType = 'Left';  // Left, Right, None (case sensitive)
    if($sidebarType == 'None') { $noSidebar = $sidebarType; } else { $noSidebar = ''; }
    
    $sidebarIncludes[2] = 'email';
    $sidebarIncludes[4] = 'backtolist';
    $sidebarIncludes[5] = 'pastors';
    ?>
    
    
    {exp:channel:entries channel="profile" status="Approved" entry_id="769" show_future_entries="yes" limit="1"}
    
    
    
    <?
    /////////////////////////////////////////////////////////////
    // START CONTENT HERE
    ///////////////////////////////////////////////////////////////////////////////
    ?>
    
    {embed=includes/doc-start-1 page_name="Phoenix First \\\\\\\\ {title}" page_description="" page_keywords=""}
    
    <? //////////////////////////////////
    // CUSTOM STYLES AND SCRIPTS
    ////////////////////////////////// ?>
    <style type="text/css">
    
    {embed=styles/new-profile-detail}
    {if field_id_117 != ''}
    #headerBg{width:100%; background:url({field_id_117}) center bottom no-repeat;}
    .fixed { overflow:hidden; height:{field_id_118}px; padding:0; margin:0; width:100%; background:none;  }
    {/if}
    
    </style>
    
    {embed=includes/doc-start-2}
    
    {embed=includes/nav}
    
    {embed=includes/header-start}
    
     <div class="fixed">
      <a href="http://{facebook}%22id=%22content%22&gt&lt/a&gt&lth1{if" class="textHidden">[url=http://www.phoenixfirst.org/design/icons/facebookicon.png{if:else}<a]http://www.phoenixfirst.org/design/icons/facebookicon.png{if:else}<a</a> href="#">{/if}[/url]</span>
    {if twitter != ''}<span class="profileSocial"><a href="http://twitter.com/{twitter}">http://www.phoenixfirst.org/design/icons/twittericon.png{if:else}<a href="#">{/if}</a></span>
    {if field_id_125 != ''}<span><a href="http://{field_id_125}">http://www.phoenixfirst.org/design/icons/storeicon.png{if:else}<a href="#">{/if}</a></span></h3>
    <p>602-867-7117 ext. {field_id_3} • <a href="mailto:{field_id_5}">Email {field_id_1} {field_id_7}</a></div>                                    </p><h3>ABOUT {field_id_1} {field_id_7}</h3>
    <p><div class="profileBio">{biography}</div></div><br />
    {/exp:channel:entries}</p>
    
    <p><br />
                                  <div class="tbCol2"><br />
                                  <br />
                                  <div class="tbspeaking"><br />
                                  <br />
                                  </p><h2>Speaking Engagements</h2>
    <p>                              <br />
    {exp:channel:entries channel="tb_speaking_engagement" status="Approved" sort="asc" order_by="expiration_date" show_future_entries="yes" limit="5"}<br />
    {if field_id_158}<date>{field_id_158}</date></p>
    
    <p><church>{field_id_159}</church></p>
    
    <p>{field_id_160}</pastor></p>
    
    <p>{if field_id_161}<a href="http://{field_id_161}">More Info >>></a><br />
    {/if}</p>
    
    <p>{/if}<br />
    {/exp:channel:entries}<br />
    </div></div></div></div></div></p>
    
    <p>{!-- CONTENT ENDS HERE ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --}</p>
    
    <p>    </div><br />
                    <div class="contentDivs<?=$sidebarType;?>" id="contentSidebar<?=$noSidebar;?>"><br />
         <div class="sidebarTopPadding"></div></p>
    
    <p><br />
    {!-- ////////////////////////////////<br />
    // EMBED THE MINISTRY NAVIGATION, ETC<br />
    ///////////////////////////////////// --}</p>
    
    <p><?<br />
    if($sidebarType != 'None') {<br />
        foreach($sidebarIncludes as $include) {<br />
            echo '{embed=sidebar/'.$include.' sidebarType="'.$sidebarType.'"}';<br />
        }<br />
    }<br />
    ?></p>
    
    
    
    <p> </p>
    
    <p>    </div><br />
                    <div class="clear"></div></p>
    
    <p><br />
    {!-- SIDEBARS END HERE //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// --}<br />
                    </p>
    
    <p>{embed=includes/content-end}    </p>
    
    <p>{embed=includes/footer}</p>
    
    <p>{embed=includes/doc-end}

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

ExpressionEngine News!

#eecms, #events, #releases