<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html" />
  <link rel="self" type="application/atom+xml" href="http://forums.movabletype.org/atom.xml" />
  <id>tag:forums.movabletype.org,2011://24/tag:forums.movabletype.org,2009://24.13393-</id>
  <updated>2011-09-01T02:26:38Z</updated>
  <title>Comments for Alphabetize Tag Search Results?</title>
  
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.292</generator>
  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393</id>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.movabletype.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=24/entry_id=13393" title="Alphabetize Tag Search Results?" />
    <published>2009-03-20T21:46:42Z</published>
    <updated>2010-11-27T13:38:15Z</updated>
    <title>Alphabetize Tag Search Results?</title>
    <summary>Is it possible to alphabetize the results of mt:searchresults? Right now I use the MT tag function and search to display my recipe index here: http://www.elise.com/recipes/subject-index.php When you click on any of these tags however (take http://www.elise.com/recipes/tag/Chicken%20Breasts for example) the...</summary>
    <author>
      <name>Elise Bauer</name>
      <uri>http://elise.com</uri>
    </author>
    
    <category term="Design, Templates, &amp; Tags" />
    
    <content type="html" xml:lang="en" xml:base="http://forums.movabletype.org/">
      <![CDATA[<p>Is it possible to alphabetize the results of mt:searchresults?</p>

<p>Right now I use the MT tag function and search to display my recipe index here:</p>

<p>http://www.elise.com/recipes/subject-index.php</p>

<p>When you click on any of these tags however (take http://www.elise.com/recipes/tag/Chicken%20Breasts for example) the results are in order of when they first appeared on the blog, most recent first, rather than alpha.</p>

<p>It would make a lot more sense for the results to be in alpha order.  </p>

<p>Possible?</p>]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20505</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20505" />
    <title>Comment from Alex E. Schneider on 2009-03-21</title>
    <author>
        <name>Alex E. Schneider</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>What should the list of Entries tagged with Chicken Breasts be ordered by, if not by authored_on date? You say alpha (meaning alphabetically I guess) but what field/criteria do you want to order by? Entry title?</p>]]>
    </content>
    <published>2009-03-21T19:28:46Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20509</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20509" />
    <title>Comment from Elise Bauer on 2009-03-21</title>
    <author>
        <name>Elise Bauer</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Yes, alphabetized by title.  As if it were the index in a cookbook.</p>]]>
    </content>
    <published>2009-03-21T19:54:14Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20521</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20521" />
    <title>Comment from Alex E. Schneider on 2009-03-21</title>
    <author>
        <name>Alex E. Schneider</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Yes that's possible. </p>

<p>1. you could create 26 mt:If blocks each asking if EntryTitle starts with a given letter like=&quot;&circ;(A|a)&quot;, thus permitting only those Entries to pass that start with the given letter.</p>

<p>2. Use mt:EntryIfTagged 26 times. This would require you to tag each Entry first, for example: @a, @b, or @alpha-a, @alpha-b, etc..</p>

<p>3. Create an Entry template with an archive mapping that publishes entries to folders /a, /b, /c etc. based on your input into a custom field on the Edit Entry screen. Then try to create a loop with the mt:Folders tag .... all right. I'll stop here. This leads nowhere.</p>

<p>Hm, what else...</p>]]>
    </content>
    <published>2009-03-21T22:54:04Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20525</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20525" />
    <title>Comment from Elise Bauer on 2009-03-21</title>
    <author>
        <name>Elise Bauer</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hmm.  Number 1 seems doable, though it seem like it might slow down the rendering of the results.  It's also rather clunky.</p>

<p>There should be an attribute for the result listing.</p>]]>
    </content>
    <published>2009-03-22T00:21:10Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20531</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20531" />
    <title>Comment from Su on 2009-03-21</title>
    <author>
        <name>Su</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Clunky, and trying way too hard, primarily by sticking with the core tags. And yes, there will be <em>major</em> impact on rendering time.</p>

<p>Have you tried the Order plugin(as the sort's simple) or Collate? The search system is always a little weird, but assuming that doesn't come into play, Order will make this trivial.</p>

<p>Also a sort attribute is entirely reasonable for search results. File a feature request?</p>]]>
    </content>
    <published>2009-03-22T01:25:39Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20543</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20543" />
    <title>Comment from Elise Bauer on 2009-03-21</title>
    <author>
        <name>Elise Bauer</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hi Su, just tried the Order plugin.  Couldn't get it to do anything, but that could be because I don't really know how to implement the code properly in to mt:searchresults code.  Really wish plugin authors would explain their examples better.  I'll have Jesse take a look at it next week.  Thanks!</p>

<p>Given that a sort attribute is an entirely reasonable thing for search results, I was hoping that it was already in there somewhere. I'm sure someone has filed this as a feature request years ago, but can do so again.  Thanks again!</p>]]>
    </content>
    <published>2009-03-22T05:57:10Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20555</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20555" />
    <title>Comment from shenews on 2009-03-22</title>
    <author>
        <name>shenews</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hi, Elise, trhis issue did come up in the old forums in 2006: <a href="http://forums.sixapart.com/index.php?showtopic=59000&amp;st=0&amp;p=243134&amp;#entry243134" rel="nofollow">Search Titles Only And Alphabetize Search Results</a>, in the next to last post, by elf#3:</p>

<blockquote>In the template tags and the Widget: search, it looks like search is limited, but if you read the 3.2 manual section, apparently you can extend the search functionality WELL beyond what is on the basic template. (I had to laugh, because the template that I'm using offers up a "regex" search checkbox option to the user, as if anyone but geeks knew that that was ... chuckle).

<p>It appears there are parameters already built in to limit search to certain field and possibly to sort on more than create date:<br />
<pre></pre></p>

<p>&lt;b&gt;Sort By:&lt;/b&gt;<br />
&lt;select name="SearchSortBy"&gt;<br />
&lt;option value="created_on"&gt;Authored On Date&lt;/option&gt;<br />
&lt;option value="title"&gt;Title&lt;/option&gt;<br />
&lt;/select&gt;&lt;br /&gt;<br />
&lt;b&gt;Sort Order:&lt;/b&gt;<br />
&lt;select name="ResultDisplay"&gt;<br />
&lt;option value="ascend"&gt;Ascending&lt;/option&gt;<br />
&lt;option value="descend"&gt;Descending&lt;/option&gt;<br />
&lt;/select&gt;&lt;br /&gt;<br />
</p></blockquote>

<p><br />
<a href="http://www.sixapart.com/movabletype/docs/3.2/10_search/public_search_form.html" rel="nofollow">Creating a Search Form</a> -- the 3.2 docs page the poster references -- says, </p>

<blockquote>Most of the bells-and-whistles in this form may not be overridden by the reader. Here is an HTML form that exposes those options to the reader:

<p><br />
[...code, including that cited above...]</p>

<p>This form exposes all of the options to the reader for tailoring to their own liking. Optionally, these parameters can be passed to the search script via hidden input tags. A benefit of using this approach is that configured options are set only for the reader and won't alter parameters in the MT configuration file that may be used by the search elsewhere in the site.</p></blockquote>

<p><br />
From the old docs, </p>

<blockquote><a href="http://www.sixapart.com/movabletype/docs/3.3/d_configuration_directives/searchsortby.html" rel="nofollow">Chapter D: Configuration Directives</a>
SearchSortBy

<p>The sort column for the search results. Using created_on will sort the entries by the authored on date; using title will sort the entries by title. This can be used with ResultDisplay to sort in either ascending or descending order.</p>

<p>Default value: created_on</p>

<p>Example:</p>

<p>    SearchSortBy title<br />
</p></blockquote>

<p><br />
It <i>sounds</i> doable, if you can change option values.</p>]]>
    </content>
    <published>2009-03-22T13:01:10Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20577</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20577" />
    <title>Comment from Elise Bauer on 2009-03-22</title>
    <author>
        <name>Elise Bauer</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hello shenews,</p>

<p>Bingo, thank you!   The following configuration directives worked!</p>

<p>SearchSortBy title<br />
ResultDisplay ascend</p>

<p>You have to include the "ResultDisplay ascend" or the "SearchSortBy title" will not work.</p>

<p>Now <a href="http://www.elise.com/recipes/tag/Chicken%20Breasts" rel="nofollow"><a href="http://www.elise.com/recipes/tag/Chicken%20Breasts" rel="nofollow">http://www.elise.com/recipes/tag/Chicken%20Breasts</a></a> is in alphabetical order.</p>

<p>The downside of this technique for those who might be interested in it is that it affects all search results on your MT install, not just the specific instance of one search result.  In my case, it doesn't matter as I use Google search for almost all other searches on the site, and in the case that I do use mt search, I want the results listed by title.</p>

<p>The upside is that it is the easiest thing in the world to implement.  No plugins. No messing with code on templates.</p>]]>
    </content>
    <published>2009-03-22T16:57:28Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20589</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20589" />
    <title>Comment from shenews on 2009-03-22</title>
    <author>
        <name>shenews</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Excellent! </p>

<p>I wonder if it could be restricted for use on just a specific blog and/or tag. Something like</p>

<p>&lt;select name="SearchSortBy"&gt;<br />
&lt;mt:IfTagSearch tag="Chicken"&gt;<br />
&lt;option value="title"&gt;Title&lt;/option&gt;<br />
&lt;mt:Else&gt;<br />
&lt;option value="created_on"&gt;Authored On Date&lt;/option&gt;<br />
&lt;/mt:IfTagSearch&gt;</p>

<p>and the same for the sort order. (Not sure about syntax, if you'd need to use an mt:If tag="Chicken" and the same kind of conditional for "Include blogs" or if you can change that part of the form at all.)</p>

<p>I've been a frequent visitor to your recipes, btw. Great cooking blog.</p>]]>
    </content>
    <published>2009-03-22T19:07:22Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:20601</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c20601" />
    <title>Comment from Elise Bauer on 2009-03-22</title>
    <author>
        <name>Elise Bauer</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hmm.  Good question.  In any case the code works for my site as is, so no more messin' with it for me!  Thanks again.</p>]]>
    </content>
    <published>2009-03-22T21:36:14Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:49099</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c49099" />
    <title>Comment from Gautam Patel on 2010-11-27</title>
    <author>
        <name>Gautam Patel</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>&lt;mt:searchresults&gt; seems to take the modifiers "sort_order" and "sort_by" (same as &lt;mt:entries&gt;> correctly. </p>

<p>So you <b>can</b> do something like<br />
<blockquote><pre>&lt;mt:searchresults sort_by="title" sort_order="ascend"&gt;</pre></blockquote></p>]]>
    </content>
    <published>2010-11-27T13:21:40Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13393-comment:49105</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13393" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/alphabetize-tag-search-results.html#c49105" />
    <title>Comment from Gautam Patel on 2010-11-27</title>
    <author>
        <name>Gautam Patel</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>The <a href="http://www.movabletype.org/documentation/appendices/config-directives/searchsortby.html" rel="nofollow">SearchSortBy</a> and <a href="http://www.movabletype.org/documentation/appendices/config-directives/searchresultdisplay.html" rel="nofollow">SearchResultDisplay</a> configuration directives may not be essential to achieve a sorting of search results as the code instance above seems to correctly combine the effect of both configuration and has the added advantage of not being system-wide but usable on a per-template/per-blog basis.</p>

<p>In fact, the configuration directives will conflict with, and over-ride, this usage in the template.</p>]]>
    </content>
    <published>2010-11-27T13:38:15Z</published>
  </entry>

</feed>

