user-pic

MTIfFolder buggered up in 4.21

Vote 0 Votes

Hi,

I just upgraded from 4.12 to 4.21. A similar problem was reported here (http://www.movabletype.org/cgi-bin/mt/mt-query.cgi?IncludeBlogs=24&search=mtiffolder) but the solution offered is not working for me. I have not had a reply to my issue so far and perhaps the title there is not indicative enough of the problem.

Here is my code: [ the solution suggested by Gautam that worked for dimlau ]

So I have a title for the section, and when one is in that section the subnav shows up. It's also possible to do this with keywords, but that would mean one more thing my client has to remember once per year to include in new pages for the category.

It's giving me the out-of-context error that dimlau mentioned, regardless of whether it's in a page or an index template. I need to get this working again ASAP. Thanks in advance for your help!

Reported on Movable Type 4.2

7 Replies

| Add a Reply
  • Er... my code disappeared...








  • Hi,

    I'm shooting blind here, but I think this has to do with **<mt:else>** (or its equivalent <mt:elseif>) not working outside of the <mt:if> context. At least that's my reading of the documentation on <mt:else>.

    So let's try and use the <setvarblock> functions to get this to work:

















    I think that should work. Let me know.

  • Hi Gautam,

    Thanks for your reply. Your solution made the subnav items repeat several times, so I used it to tinker with what I had originally and finally got it to work like this:

    <mt:If tag="PageTitle" eq="Schools List">
    <$mt:include module="Left nav - schools subnav"$>
    </mt:If>

    <mt:Else>
    <MTIfNonEmpty tag="pagefolder">
    <mt:IfFolder label="Schools List">
    <$mt:include module="Left nav - schools subnav"$>
    </mt:IfFolder>
    </mt:IfNonEmpty>
    </mt:Else>

    It didn't seem to matter whether I included the <MTPages> tag or not, but it occurred to me that I was starting out with an MTIfFolder without introducing an MTFolders tag first. That tag wasn't quite right, but the MTIfNonEmpty did the trick! Phew...

    I wish Six Apart would be more explicit and note that the MtIfFolder tag has to be inside something else... or maybe I missed something. Anyway, thanks again, we got it figured out! Thank goodness.

  • Argh, haha, how do you get the brackets to show up? In my email it showed < and > but now in my email it's showing ampersands. Sigh... Anyway, hope you can read that...

  • Your code should read:









    :-) I don't about email, but you should just cut and paste it here with about 8 spaces in front of each line. Works just fine.

    I agree, your code is neater. Well done!

  • Your code should read:









    :-) I don't know about email, but you should just cut and paste it here with about 8 spaces in front of each line. Works just fine.

    I agree, your code is neater. Well done!

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012