Help - Search - Members - Calendar
Full Version: Creating A News Page
Movable Type Community Forum > Additional Resources > Tips and Tricks
mookie
Basically I've created a nice news page that posts music news on it. On this page you get the news items title, a small excerpt of the item, and thats it. When you click the [read more] link it then moves to a new page with the full news item displayed to read.

Here is my problem. It has slowly dawned upon me that every news item will be archived on a monthly and individual basis. This means every time i post a new item MT rebuilds all the existing pages. I can see that sometime in the future this is going to be a real problem as the rebuild time will be insane due to a massive number of pages to rebuild each time.

Can anyone advise me on the most efficient way to set things up so that I can update as often as possible but still retain the ability to display news items as individual entries? I've tried turning off the individual archive in the Weblog Pref's but this just means the item wont display and I get a 'page not found' type error instead.

I'd be especially grateful for advice from anyone on how they achieved their own news pages etc.

Cheers in advance.
crys
It *doesn't* rebuild every page each time you add or edit an entry. It rebuilds all index templates and the appropiate archive pages (with individual and monthly turned on that's -- the entry's page, the next and previous entries (to update the next and previous links if used), the relevent month, and the months before and after (again to update links)).
mookie
The thing is I have a sidebar with links to all the news stories that goes on all the pages. I've found unless I rebuild the whole site it doesnt seem to update the links on the older pages... should that be happening? That's what prompted me to ask basically.
crys
/Ah/ -- the best thing to do would be to use PHP or SSI to include that side bar on every page, rather than rebuilding every page each time.

Basically cut and paste the side bar code into a new index template, and name it somting like sidebar.inc

Then where the sidebar code was replace it with:

PHP
CODE
<?php include ("<MTBlogPath>sidebar.inc"); ?>


SSI
CODE
<!--#include virtual="<MTBlogRelativeURL>sidebar.inc" -->


And you'll need to make sure the page is processed for PHP or for SSI as appros.
mookie
Cheers I'll give a whirl. smile.gif I may just simply things by using a modified version of the main index for all other pages (news and reviews) with the sidebar removed. I've seen a few sites do that and done correctly it looks fine. However that PHP include looks very useful so hopefully I can get it working as I want it afterall.

p.s Anychance you can explain what you mean by "And you'll need to make sure the page is processed for PHP or for SSI as appros." mellow.gif
kadyellebee
crys said:
QUOTE
make sure the page is processed for PHP or for SSI as appros


Check to make sure that your server supports PHP or SSI, and then change your extensions to .php or .shtml.

For more help, check out MT Wiki: Converting to PHP smile.gif

Kristine
mookie
Please forgive my n00bness in regards php...

I've done the following:

1. Cut out the sidebar code and replaced it with
CODE
<?php include ("<MTBlogPath>sidebar.inc"); ?>

2. I create a new template, called it 'sidebar.inc', and set it's output file to sidebar.php, and pasted in the sidebar code.
3. Changed the output file for the main index template to 'index.php'.

And this is where I think I must be going wrong as I don't get anything appearing where the sidebar was... gah. I've tried combinations of file extensions and none of them seem to work. I know my host is php enabled so any idea where I have gone wrong?
kadyellebee
Since your output file is sidebar.php, try changing the include statement to use sidebar.php instead of sidebar.inc.

If that doesn't help, here's a few other things to check... If you view the source of your page, is there anything in the space where the sidebar should be?

You might double check that you deleted the .html version of the page in case your browser is automatically taking you to the old version.
smile.gif
Kristine
mookie
Woo it works a treat! Thanks!

Any idea if the php include would work in conjunction with MTOtherBlog? My idea is to creat a sidebar.php index for a couple of other blogs (reviews, links) and the use the include to reference their own sidebar and so stack a bunch of different sidebar.php in my sidebar region. Because when I think about it, unless the main blog is rebuilt the sidebars wont reflect changes in the other blogs they are referencing.

EDIT: Just found this thread. Looks like it explains exactly what I want to do. Fab!
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.