Help - Search - Members - Calendar
Full Version: Create static page from template
Movable Type Community Forum > Using Movable Type > Templates and Tags
mactoph
I am interested in creating a static page that I can link to similar to an individual entry page, but not a part of any category or associated with a date.
I've been going through the forums, as I'm sure this is answered somewhere, but I guess I'm not searching for the right thing- if anyone could point me in the right direction, it would be much appreciated.
Basically, I want to create a static page that pulls its formatting from the default index template.
Thanks much,
Christopher
TxFx.net
If you convert your index template into php includes by cutting it up... that is, taking out all the parts that aren't the MT Entries tag, you can make a new static page by calling the various parts and putting the content where MT Entries tag would normally go. So your page would look something like this:
CODE
<?php include 'header.php'; ?>
PAGE CONTENT
<?php include 'footer.php'; ?>


Of course that is a simplification, but the basic idea is cutting your page up into building blocks and then calling those building blocks with the php include function. The main benefit to this is that you can make site-wide changes without a total MT rebuild and it makes making static pages like the one you were talking about really really easy.
mactoph
TxFx.net,
It has taken me a bit to get back to you- I'm not sure I completely understand the concept huh.gif -

When I bring the content of my index template into a php file, how to I treat the MT tags?

Also, I'm assuming I just place the header, footer php includes in a separate folder, right?

I guess I'm confused as to how the header and footer content will get rebuilt if I have it as a separate file- does MT automatically do that?

Sorry for all the questions- and thanks for any help!?!
gvtexas
QUOTE (mactoph @ Jan 20 2004, 10:48 PM)
Basically, I want to create a static page that pulls its formatting from the default index template.

I've done this several times in several ways. Easiest may be to create a special category for your static page and then use the ExcludeCategory plugin for your main, date-based, and category-based archives. The page will process mt tags, and show only when you use a hard-coded link to the individual archive for this static entry.

I've used this for "about" pages, "this month in history" pages, etc. Works well.

UPDATE: Sorry, did all this last year and forgot what I did. Remembered now that the ExcludeCategories plugin is fine when the MTEntries tag is involved, as on your main page. If you want to keep the special static category from appearing in your listings of categories, you'd use the FilterCategories plugin for that use.
mactoph
QUOTE (gvtexas @ Jan 27 2004, 10:25 AM)
QUOTE (mactoph @ Jan 20 2004, 10:48 PM)
Basically, I want to create a static page that pulls its formatting from the default index template.

I've done this several times in several ways. Easiest may be to create a special category for your static page and then use the ExcludeCategory plugin for your main, date-based, and category-based archives. The page will process mt tags, and show only when you use a hard-coded link to the individual archive for this static entry.

I've used this for "about" pages, "this month in history" pages, etc. Works well.

gvtexas,
Perfect- that sounds like a great way to go about it- thanks so much!
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-2010 Invision Power Services, Inc.