I’m completing the “future-proofing” of MT individual archives. This involves using the Regex plugin, but also potentially modifying the “trackback” and “comments” portions of MT- I have to change these in a way which doesn’t break all the other blogs on the system.
It must be possible to implement these changes in a way such that:
- doesn’t generate too much per-blog manual work for new blogs- blogs using the default setup should not have to deal with my insanity
- affects other existing blogs as little as possible
- when possible, separates the server address (the machine hosting MT) from the individual blog (zeromachine) – there should be no references to the server machine in the blog. This is to hide implementation as well as making the blog easier to move to alternate servers.
Due to this first requirement I also have to fix the Search functionality, which shows the name of the server after the second search.
And finally, I also made changes to the
CategoryHeaderFooter plugin, because quite frankly it was totally broken. Much like the comment functionality on the author’s site, so I cannot communicate my fix to anyone. Screw ’em.
- Search:
- The Search library included with Movable Type actually does have logic in it which looks for user-specified blogs in which to search… but they don’t include that flag in the generated search page returned by the search! So if you do more than one search, suddenly you will be searching in every blog on the system….
- The form field in question is “IncludeBlogs”
- I was about to go buck-wild and have the script remember the value of the previous search… but it’s easier (and more sensible) to change the default template so that searches automatically search only the blog you are on at the beginning of the search. Like, I can’t think of an example of why I would want to enable searching every blog on our server, since they all belong to different people. Obnoxiously, this is an intentional feature with a simple solution: add the hidden “IncludeBlogs” element to the default search template!
- Still a problem- the CGI location is still the general one, listing the server’s name, which does not match the blog’s domain name. To solve this problem originally, shac and I set our scripts to name the root apache cgi-bin directory, so our cgi location was /cgi-bin/mt … but I wonder if it wouldn’t be better to alias the MT directory inside that one to our “cgi-bin”s in the Apache httpd.conf so we could just use it as if it’s at cgi-bin. Then we could change the default search template (action is previously <$MTCGIPath$><$MTSearchScript$>) to name “/cgi-bin/search” etc and wouldn’t have to worry about changing it for every blog in the future. Okay, I’ll do that.
- actually no I won’t- I’ll just set it to the empty string, “”. That is because the template is always returned by the search cgi URL, and so sending the new result to the same location will be to the same executable.
- This is a problem also for Comments because of the “Preview” button- MT returns a page from the base level general to all the blogs on the installation. Fortunately, unlike the search page, the comments pages are modifyable on a per-blog level.
- “Future-proofing“:
- CategoryHeaderFooter:
- line 40 was totally wrong, naming a nonexistent variable $header rather than its actual name, $headerData
- error messages for header/footer macro definitions are returned by the subroutines, but then they show up in the page.
So I guess you are intended to put the defs within a comment block in the template’s HTML… to make this easier I had them print out inside their own comment blocks