{"id":3631,"date":"2005-12-30T01:37:10","date_gmt":"2005-12-30T09:37:10","guid":{"rendered":"http:\/\/michaelhans.com\/eclecticism\/2005\/12\/30\/tag-intersections\/"},"modified":"2019-12-19T15:29:36","modified_gmt":"2019-12-19T23:29:36","slug":"tag-intersections","status":"publish","type":"post","link":"https:\/\/michaelhans.com\/eclecticism\/2005\/12\/30\/tag-intersections\/","title":{"rendered":"Tag Intersections"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:7209,&quot;href&quot;:&quot;http:\\\/\\\/code.appnel.com\\\/tags-app&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>A little bit more work on improving the <a href=\"http:\/\/code.appnel.com\/tags-app\" title=\"Appnel Internet Solutions: Tags.app\">tags.app<\/a> implementation here.<\/p>\n<p>By default, tags.app&#8217;s results page from performing a tag search is very sparse &#8212; simply a bulleted list of post titles, presented ten at a time. One of the first things I did when tweaking my install was to enhance the page a bit by adding post excerpts, author, and time\/datestamps to each entry. I also added a list of &#8216;related tags&#8217; in the sidebar of the results page.<\/p>\n<p>While tinkering around with adding the <a href=\"https:\/\/michaelhans.com\/eclecticism\/2005\/12\/this_is_a_test_1.html\" title=\"Eclecticism: This is a test...\">tag search field<\/a> tonight, I realized that it shouldn&#8217;t be hard at all for me to add easy tag intersection searches to the tag results page. A few tweaks later, and it&#8217;s done: when a search on a tag is performed, the list of related tags now includes a small &#8216;<strong>[+]<\/strong>&#8216; symbol before each tag. Clicking on the tag itself will start a new search for that tag alone &#8212; but clicking on the <strong>[+]<\/strong> will <em>add<\/em> that tag to the search (and narrow down the &#8216;related tags&#8217; list dramatically). I&#8217;ve been playing with this, and it&#8217;s making it <em>very<\/em> easy to drill down through the thousands of entries on the site very quickly.<\/p>\n<p>Code snippets follow.<\/p>\n<p><!--more--><\/p>\n<p>First: my changes to the &#8220; section:<\/p>\n<pre><code>  &lt;h3&gt;Local tag search for '':&lt;\/h3&gt;\n   items total (Page \n   of )\n\n   &lt;a&gt;\" title=\"Previous\"&amp;gt;&amp;laquo; Previous 10 &amp;laquo;\n   &lt;\/a&gt;&amp;nbsp;&lt;a&gt;\" \n   title=\"Next\"&amp;gt;&amp;raquo; Next 10 &amp;raquo;&lt;\/a&gt;\n\n  &lt;ul&gt;\n\n &lt;li&gt;&lt;strong&gt;&lt;a&gt;\"&amp;gt;&lt;\/a&gt;&lt;\/strong&gt;: \n\n  Posted by \n    on  @ \n    &lt;\/p&gt;&lt;\/li&gt;\n\n  &lt;\/ul&gt;\n  &lt;p&gt;\n   &lt;a&gt;\" title=\"Previous\"&amp;gt;&amp;laquo; Previous 10 &amp;laquo;\n   &lt;\/a&gt;&amp;nbsp;&lt;a&gt;\" \n   title=\"Next\"&amp;gt;&amp;raquo; Next 10 &amp;raquo;&lt;\/a&gt;\n\n\nNo search performed.\nNothing found.\n<\/code><\/pre>\n<p>Next, the &#8216;related tags&#8217; section I inserted into the sidebar:<\/p>\n<pre><code>&lt;div&gt;\n &lt;h2&gt;Related tags:&lt;\/h2&gt;\n &lt;div&gt;\n  &lt;ul&gt;\n   &lt;li&gt;&lt;a&gt;mt-tags.cgi?blog_id=&amp;amp;\n    tags=+\" title=\"Add '' to \n    the current search\"&amp;gt;&lt;strong&gt;[+]&lt;\/strong&gt;&lt;\/a&gt; &lt;a&gt;mt-tags.cgi?\n    blog_id=&amp;amp;tags=\" title=\"Local tag search for ''\"&amp;gt;\n    &lt;\/a&gt;&lt;\/li&gt;\n  &lt;\/ul&gt;\n &lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<p>Looks complicated, but it was actually all fairly easy to puzzle out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A little bit more work on improving the tags.app implementation here: tag intersection searches from the search results page.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2040],"tags":[25],"class_list":["post-3631","post","type-post","status-publish","format-standard","hentry","category-blog","tag-website"],"_links":{"self":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/posts\/3631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/comments?post=3631"}],"version-history":[{"count":0,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/posts\/3631\/revisions"}],"wp:attachment":[{"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/media?parent=3631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/categories?post=3631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelhans.com\/eclecticism\/wp-json\/wp\/v2\/tags?post=3631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}