Hi, all -
I've been working away at learning how to use MT for the last week, and I'm hitting walls all over the place. :\ Worse yet, I can't find any documentation for what I want to do - or anything on the Web that would point me in the right direction. I have high hopes for being able to use MT... but at the moment, it's just not happening.
To give a little context: I'm the Editor-in-Chief for the Linux Gazette (http://linuxgazette.net/). For years now, we've been using a "home-made" set of Python scripts to generate/publish LG, with me keeping the whole rickety setup alive by grafting lots of Perl code onto it, tweaking the templates, reworking the CSS, etc. Recently, though, a friend recommended that I take a look at MT. I was delighted when I did - MT produces static files, which is exactly what we need. I grabbed a copy, installed it, and...
Well, I've been able to produce a pretty good-looking index page for LG. I've even separated out the banner header template - great, that should save on some work! However, when I try to do anything just a touch more complicated - e.g., use MT logical statements to eliminate the sidebar - all I get is errors. E.g.:
Publish error in template 'Main Index': Error in <mtHasParentFolder> tag: You used an MTHasParentFolder tag outside of the proper context. Close
I'm not sure where to go from here. I'm a professional Perl and PHP programmer and instructor, I can do HTML and CSS in my sleep, I've got years of publishing experience under my belt... but this CMS thing has got me rather discouraged. I just don't feel like I'm grasping the essentials here.
Any advice - including hints of where I might have picked the wrong approach - would be highly welcome and appreciated.
Reported on Movable Type 5
If you need to remove the sidebar, it would be better to just remove the <mt:Include> tag that imports it.
The error you got means that you used a HasParentFolder tag outside of a <mt:Folders> or <mt:PageFolder> block tag. Context is everything here. If you can't find where you used a HasParentFolder tag outside of the appropriate context, then post your markup here.
Thanks for your reply, Mike. Again, the problem is not so much that specific tag as my understanding of the whole MT system: I understand the concept of context - heck, I teach Perl classes for a living - but I don't understand what the term means here. If I'm editing the templates for the top-level 'index.html', is context applicable? If it is, what is the context? Or is it set by surrounding the tag with other tags, /a la/ PHP?
What I'd like to do with this site, overall, seems like a reasonably simple thing in theory: top level index page and some supporting files (faq.html, about.html, sitemap.html, images/*, etc.), then a bunch of numerical directories (e.g., 175/, 176, etc.) containing individual issues of the Linux Gazette. So far, I've succeeded in building that top-level index - but when I tried to generate the FAQ by simply copying the content from the original, plain-HTML source, I got the sidebar (which should appear only in the top-level index.) Now, I can find the template files for that index - but I can't find a way to tell MT to use a different template for the FAQ, so it seems that I need to modify that 'Banner Header' template so that it acts differently based on which file it's being applied to. The only logical I could see that was relevant was 'HasParentFolder'... and that's where I got stuck.
So - the help that I'm asking for isn't so much "how do I fix the problem with 'HasParentFolder'" but an explanation, or perhaps a pointer to an explanation, of how this whole interaction is supposed to work and how "context" relates to this. Right now, I really am completely at sea and groping for clues.
Again, thanks very much for any help you can offer.
Context here means one of two things:
1) Most function and some block tags cannot be used outside of an appropriate block tag. Usually, this is self-explanatory when you look at the template tag documentation. For example, you can't just put <mt:CommentID> in any old location. It must be inside of a <mt:Comments> block tag.
2) Implicit context gained by the CMS applying the appropriate data to a template when rebuild it. For example, you can implicitly call <mt:EntryTitle> anywhere inside an "individual archive" because when that template is being rebuild, the "entry context" is injected by the CMS so the EntryTitle tag will have everything it needs to return that value.
From the sound of it, your problem is that you are using HasParentFolder outside of the appropriate context. If your FAQ is published in a regular MT "page" object (Create menu->Page), then you could do something like this:
around the sidebar module's content to have it only display on the main index.