user-pic

Search results and archives not parsing php

Vote 0 Votes

I have php includes in all my mt templates so that I can change my whole site all at once. Maybe I am going about this wrong but the static pages in my site are php for this reason and I don't want to have to edit my header in two different places. Either way...the problem is I have my site skinned with my theme and when I use the search or if I click on the tag cloud I get an unformated page. If I look at the page source I can see the php include in the source so it tells me the web server doesn't know this is a php page. I've checked all the places thatt I can and it looks like I have everything set to use php. Please tell me the obvious because even though I think i've checked it all...I might be missing something. You can look at my site at: http://g33k.net Thanks in advance

Reported on Movable Type 4.2

5 Replies

| Add a Reply
  • I'm sorry I typed this wrong. It actually is search results and when I click on the links in the tag cloud...which I'm assuming is basically a search for items with that as a keyword and then displayed using the search results template. So basically is the only way for me to skin/theme that page to put my html in there...or is there a way I can use my php includes in this file?

    • Your problem seems to be that you are mixing a CGI script and PHP. The search results are dynamically generated by the search CGI script, and thus PHP won't get executed. What you're going to have to do is take header.php and build it into your search result templates if you want this to work.

    • By including header.php, what I mean is that you're going to have to take the markup that you want from header.php and put it into the search result templates; any PHP code you try to put in there still won't get executed.

  • That's what I was thinking I'd have to do. I was hoping that I'd be able to keep it dynamic so if I add links in my header or change an image etc. that I'd only have to do it in one place. Oh well....thanks for the confirmation.

  • Since you're just including a bunch of markup, there really shouldn't be any reason why you can't just turn header.php into a MT template module and use <mt:include>. In fact, I would recommend that, as that will perform better than using PHP for the same purpose. Another advantage is that if you have module caching turned on, you can designate that header module to be a cached module, and it'll only get compiled once by the template compiler during a rebuild if you so desire.

Add a Reply

Forum Groups

151 405

Last Topic: MT Interface Missing by Sherri on Nov 10, 2008

36 144

Last Topic: Installation can't finish by Drazend on Nov 10, 2008

34 93

Last Topic: Creating your own Plug-in by jondauz on Nov 5, 2008

10 33

Last Topic: new licensing confusion by Neil Epstein on Aug 14, 2008

code.sixapart.com

62 226

Last Topic: Callback after blog publishing. by Tomato Interactive on Oct 27, 2008

34 98

Last Topic: Ajax Rating Plugin by kiran on Oct 17, 2008