Does anyone know how I can do the following:
When a tag is created in MT, I want to be able to automatically have a page created that would contain a the list of entries/pages that are tagged with that such tag.
Would that result in a plugin?
I have seen documentation on creating a basic, plain plugin. But where can one go to learn how to create more enhanced plugins?
As always, I appreciate the help.
V
Reported on Movable Type 4.2
Yes. It would probably require you to do a callback on MT::Tag::post_save that looks up all of the entries that have that tag (using a join with ObjectTag) and then creating a page based on that. To do this, you'll need to read up on the following documentation:
MT::Object
MT::Page
MT::Folder (if you want to control where the pages are placed)
MT::Plugin
MT::Template
Alternatively, you could post a feature request if this isn't an essential part of your site design. Add tags to the archive file path specifiers would be a good update.
Categories already do everything you've described so far. Is there a reason for not just using them?
It's not uncommon for people to use tags far more liberally than categories. I have several hundred on my blog, and for me, this scenario would take a really long time to rebuild even with aggressive use of caching.
I think maybe we're each interpreting some part of this differently. I fail to see how having these static pages generated from tags rather than categories changes anything significant about the rebuilding implications. (Although I suspect tags will be slower, but I can't back that up right now.)
I agree that people tend to use tags more liberally, therefore this will probably result in a lot more tag(née category) pages, with likely more items per-page, being built. On the other hand, I don't think publishing concerns are the correct tack to take here, as this again changes nothing from an already-existing situation. Change the publishing method(eg. PubQueue), get more powerful hardware, etc. same as would be the case for using categories.
My issue with the question is one of functionality. So far, it just looks like vman wants to twist the tagging system into behaving like the category system. And if that's the case, why is he not just using categories?
As a sidenote, vman, you seem unsure where the developer resources even are, and that makes me lean toward suggesting you consider another plugin project(or two) before even approaching this, especially with the general state of the dev documentation. You're intending to make a core part of the app work in a way that not only was it not designed to, but that it wasn't intended to, and it's probably going to fight you the entire way, if it's even possible.
That said, the raw(and somewhat outdated) API docs are here as well as more up-to-date versions in POD in the source files themselves, the developer docs are here(which you should know), and as always, one of the best ways to figure out anything you can't otherwise is to find another plugin that already does something you're trying and pick it apart to see what that person did.
You also might consider joining the mtos-dev or Pronet mailing lists. The forums tend to stay on the end-user side of things, for the most part.
Hi Su,
Thanks for your comments. I did look for a plugin and didn't seem to find one. I generally hope that there is a plugin available as any solution for what I am looking for.
I think your idea of using categories is something to consider. The reason I asked about this is we are concerned about the performance of the tag cloud being generated by the CGI.
Just cache it such that it lasts a little while after each rebuild and that won't be an issue. Unless you're running ancient hardware, rebuilding it once is not a serious performance issue. If it were, my blog would have been crippled (2000 some posts with several hundred tags).
Well, the tag cloud is easy enough to generate statically. You didn't find a plugin primarily because you don't need one. Is that all you're trying to accomplish?
Actually displaying what entries are assigned to a tag(or tags) does currently require search, though.