Help - Search - Members - Calendar
Full Version: How To Check If A Templat Module Exist Before Including It On The Inde
Movable Type Community Forum > Using Movable Type > Templates and Tags
nycat
Hi,

I am new to MT and a little bit stumped here. On the index.html template, I'd like to do the following:

< If template module named "Primary Nav" exists >
then output the following statements
< else >
output something else.

Should I use mt:If? what comes after that? Tried <mt:If module="Primary Nav"> and that didn't work.

Thank you!
blog-coding-is-fun
Hello.

Not to side-track from your actual question, but that's sounds like an odd thing to do, particularly for a beginner or near-beginner. If the text you want to conditionally include is next to or in your 'Primary Nav' element, then it seems it would be best to put it in that module, no?

And if you're templating your own site, don't you know that this module exists? Sorry if that sounds really dumb, but seems to me that checking for a module's existence is the sort of careful check you'd make if you're creating a plugin or a style for distribution, and you want to do a dutiful check for the plugin/style's presence.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.