Help - Search - Members - Calendar
Full Version: Including Php Ouput In Search Template?
Movable Type Community Forum > Using Movable Type > Additional Features
sjordan
I wrote a php script that outputs certain nav information.

For argument, we'll call it nav.php

I'd like to display the output of nav.php in the search results.

I thought, as mt-search.cgi is a cgi, this is what Server Side Includes (SSI) are for. Within the default search template default.tmpl I placed:
QUOTE
<!--#include virtual="/nav.php" -->


And yes, mt-search.cgi, default.tmpl, and nav.php reside on the same server under the same document root.

That did not work.

Any suggestions? Would really help alot.

Thank you
sjordan
I suspect I may be thinking about the .tmpl files the wrong way in the above example.

Because they're essentially static files, they can't exec external scripts. Rather, they simply contain tokens that are replaced with values when the files are parsed by mt-search.cgi

mt-search.cgi handles assigning, generating, and/or locating these values.

What I need is to somehow introduce a new token:value pair that mt-search.cgi can use....

Anyone with an opinion either way?
maddy
If you are only wanting to include a file (rather than do any calculations or other cool PHP/SSI scripty things), you should be able to use the MTInclude tag to include the file.

CODE
<MTInclude file="/full/sever/path/to/nav.php">
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-2008 Invision Power Services, Inc.