Help - Search - Members - Calendar
Full Version: Entry Sort_by="created_on" Issues... Ver.mt3.3
Movable Type Community Forum > Using Movable Type > Entries and Archives
stevenandrew
I have an issue that I cannot figure out...

in my blog (www.subpopular.com) I am attempting to just show all the entries in all the categories that are posted to in descending order, but they entries keep grouping together in the list. I tried the Sort_by="created_on" tag, but that didn't work. Any suggestions would be greatly appreciated.

Thanks in advance.

OtherNiceMan
Can you post the template you are using.
stevenandrew
QUOTE (OtherNiceMan @ Jan 12 2008, 08:26 AM) *
Can you post the template you are using.



Here is the code I am using to drive that column:



CODE
<MTCategories>
<MTFilterCategories exclude="sitenews|topstory">
<MTEntries sort_by="created_on" order="descend">

<img src="<$MTBlogURL$>/images/categories/<MTEntryCategory dirify="1">.gif" align="right">
<$MTEntryTrackbackData$>

<MTDateHeader><h2 class="date-header"><$MTEntryDate format="%x"$></h2></MTDateHeader>
<div class="entry" id="entry-<$MTEntryID$>">
<h3 class="entry-header"><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h3>
<div class="entry-content">
<div class="entry-body">

<MTIfNonEmpty tag="EntryDataOtherImages">
<img src="<MTEntryDataOtherImages>" / style="padding: 0 3px 5px 0;" /><p>
</MTIfNonEmpty>

<MTIfNonEmpty tag="EntryDataReviewTitle">
<img src="<MTEntryDataReviewTitle>" / style="padding: 0 3px 5px 0;" align="left"><br>
</MTIfNonEmpty>
<$MTEntryBody$>

<MTIfNonEmpty tag="EntryDataLink1">
» <a href="<MTEntryDataLink1>" class="link_img"><MTEntryDataLink1></a><br />
</MTIfNonEmpty>
<MTIfNonEmpty tag="EntryDataLink2">
» <a href="<MTEntryDataLink2>" class="link_img"><MTEntryDataLink2></a><br />
</MTIfNonEmpty>
<MTIfNonEmpty tag="EntryDataLink3">
» <a href="<MTEntryDataLink3>" class="link_img"><MTEntryDataLink3></a><br />
</MTIfNonEmpty>

<MTIfNonEmpty tag="EntryMore" convert_breaks="0">
<p class="entry-more-link">
<a href="<$MTEntryPermalink$>#more">Continue reading "<$MTEntryTitle$>" »</a>
</p>
</MTIfNonEmpty>

<MTEntryIfTagged>
<div class="entry-tags"><p />
<h4 class="entry-tags-header">Tags:</h4>
<ul class="entry-tags-list">
<MTEntryTags>
<li class="entry-tag"><a href="<$MTTagSearchLink$>" rel="tag"><$MTTagName$></a></li>
</MTEntryTags>
</ul>
</div>
</MTEntryIfTagged>
</div>
</div>
<p class="entry-footer">
<span class="post-footers">
<MTIfNonEmpty tag="EntryAuthorDisplayName">
Posted by <$MTEntryAuthorLink show_email="0"$> on <$MTEntryDate format="%x %X"$>
<MTElse>
Posted on <$MTEntryDate format="%x %X"$>
</MTElse>
</MTIfNonEmpty>
</span>
<span class="separator">|</span> <a class="permalink" href="<$MTEntryPermalink$>">Permalink</a>
<MTIfCommentsActive>| <a href="<$MTEntryPermalink$>#comments">Comments (<$MTEntryCommentCount$>)</a></MTIfCommentsActive>
<MTIfPingsActive>| <a href="<$MTEntryPermalink$>#trackback">TrackBacks (<$MTEntryTrackbackCount$>)</a></MTIfPingsActive>
</p>
</div>
</MTEntries>
</MTFilterCategories>
</MTCategories>
sarah
It is the nature of the <MTCategories> tag to iterate through each of the categories in turn, so if what you mean by "entries keep grouping togethe" is that the entries from each of the categories are grouped together, then that would be the expected behaviour of the code you're using.

if you want to create a list of entries (rather than a list of categories and the entries in them), then you will want to get rid of the <MTCategories> and <MTFilterCategories> containers, and use a straight <MTEntries> container with the approriate attributes to exclude/include the categories you want to limit the listing to, eg:

CODE
<MTEntries categories="NOT sitenews AND NOT topstory" sort_by="created_on" order="descend">
stevenandrew
QUOTE (sarah @ Jan 13 2008, 01:46 AM) *
It is the nature of the <MTCategories> tag to iterate through each of the categories in turn, so if what you mean by "entries keep grouping togethe" is that the entries from each of the categories are grouped together, then that would be the expected behaviour of the code you're using.

if you want to create a list of entries (rather than a list of categories and the entries in them), then you will want to get rid of the <MTCategories> and <MTFilterCategories> containers, and use a straight <MTEntries> container with the approriate attributes to exclude/include the categories you want to limit the listing to, eg:

CODE
<MTEntries categories="NOT sitenews AND NOT topstory" sort_by="created_on" order="descend">



Ah... this makes absolute sense... i don't know where in my journey I got convinced I needed to filter the categories. I think after code for weeks one becomes delusional about things and forgets that some answers are simpler than one makes them...

Thank you for guiding me back to the straight and narrow path...

I REALLY do appreciate your help. Thank you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.