{"id":5601,"date":"2021-03-01T15:20:21","date_gmt":"2021-03-01T15:20:21","guid":{"rendered":"https:\/\/davelevy.info\/wiki\/?p=5601"},"modified":"2023-01-20T23:34:16","modified_gmt":"2023-01-20T23:34:16","slug":"two-pane-search-of-this-blog","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/two-pane-search-of-this-blog\/","title":{"rendered":"Two pane search of this blog"},"content":{"rendered":"<p>I want to build a custom search page for my whole blog space, you&#8217;d think it was easy, but it seems not. I am looking to parameterise the use of keywords or tags. Here are my notes and links.<\/p>\n<p><!--more--><\/p>\n<p>Here is a mock-up of what it might be.<\/p>\n<p><a href=\"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/03\/my-search-page.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5602\" src=\"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/03\/my-search-page-1024x655.png\" alt=\"\" width=\"640\" height=\"409\" srcset=\"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/03\/my-search-page-1024x655.png 1024w, https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/03\/my-search-page-300x192.png 300w, https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/03\/my-search-page-768x491.png 768w, https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/03\/my-search-page.png 1113w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>So making the page is not hard, or shouldn&#8217;t be. But invoking the queries, and formatting the output seems a bit harder.\u00a0 The HTML code is in <a href=\"https:\/\/github.com\/dfl1955\/multisitesearch\">this git repo<\/a>. Here are some links I found, or expect to find useful.<\/p>\n<ol>\n<li><a href=\"http:\/\/www.codestore.net\/store.nsf\/unid\/DOMM-4X9LG3\">Creating a simple search box<\/a>, at Codebox<\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/input\/search\">&lt;input type=&#8221;search&#8221;&gt;<\/a> , at the Mozilla Development Network<\/li>\n<li>Forms <a href=\"https:\/\/stackoverflow.com\/questions\/16660734\/html-form-with-multiple-actions\"><strong>can<\/strong> take multiple actions<\/a>.<\/li>\n<li><a href=\"https:\/\/pagedart.com\/blog\/how-to-add-a-search-bar-in-html\/\">How to add a search bar in html<\/a> at pagedart, which is <strong><em>awesome <\/em><\/strong>and includes the javascript<\/li>\n<\/ol>\n<p>Why is this so hard, the more I read, the harder it seems to do while avoiding javascript, or in the case of wordpress, PHP. Maybe I should search the rss or rdf, or use google search reusing <a href=\"https:\/\/pagedart.com\/blog\/how-to-add-a-search-bar-in-html\/\">the code in pagedart&#8217;s page<\/a>.<\/p>\n<p>The <a href=\"http:\/\/www.lrd.org.uk\/\">LRD home pag<\/a>e has a custom search box. The <a href=\"http:\/\/www.lrd.org.uk\/index.php\">LRD<\/a> has a search box that runs a google query, I have posted the code to github. I changed the code to point a google search at an iframe <a href=\"https:\/\/stackoverflow.com\/questions\/168455\/how-do-you-post-to-an-iframe\">using the form target attribute<\/a>, this <a href=\"https:\/\/stackoverflow.com\/questions\/18373592\/iframe-contents-cant-appear-in-firefox\">fails in Firefox<\/a>, for security reasons. The code is in <a href=\"https:\/\/github.com\/dfl1955\/multisitesearch\/blob\/main\/search-page-2.htm\">search-page-2.htm<\/a>. Running a search through my sites might not have this problem, but it is a feature and implemented by both the server site, in this case google and firefox.<\/p>\n<p>The <a href=\"https:\/\/www.toptal.com\/wordpress\/beginners-guide-wordpress-rest-api\">Beginner&#8217;s guide to wordpress rest api<\/a>\u00a0has a series of examples, although they all involve code, JS or PHP. <a href=\"https:\/\/www.lrdpublications.org.uk\/\">LRD Publications<\/a> looks like they specify the action as a separate php page.<\/p>\n<p style=\"text-align: center;\">ooOOOoo<\/p>\n<p>There&#8217;s loads of Youtube Videos about making the search box pretty.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I want to build a custom search page for my whole blog space, you&#8217;d think it was easy, but it seems not. I am looking to parameterise the use of keywords or tags. Here are my notes and links.<\/p>\n","protected":false},"author":1,"featured_media":5603,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[3,584],"tags":[577,251,253,322,144,911,28],"class_list":["post-5601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","category-wordpress-technology","tag-code","tag-css","tag-html","tag-javascript","tag-search","tag-technology","tag-wordpress"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/03\/search-anthony-martino-unsplash.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/5601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/comments?post=5601"}],"version-history":[{"count":3,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/5601\/revisions"}],"predecessor-version":[{"id":7010,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/5601\/revisions\/7010"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media\/5603"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=5601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=5601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=5601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}