August 09, 2005

Too Many Templates!

I update information on my sidebars weekly. Is there anyway to only change the information in one place versus going through 4 templates to change the information?

For example: If I want to add someone to my blogroll (even though I use blogrolling most of the time....it's just an example), I have to go to my Main Archive, Date Category, Individual Archive and Category Archive Templates to change it.

If anyone has any suggestions that work, I'll give ya a big fat virtual kiss...or buy ya a drink. I'd prefer the drink! :-)

Posted by Sissy at August 9, 2005 03:48 AM | TrackBack
Comments
#1

Sissy, what I did is turned my left and right menus into their own files, named them leftmenu.php (for example) and then included them where I wanted them to display at with the following php syntax:

<?php include "http://www.ericsgrumbles.net/scripts/leftmenu.php"; ?>
When I want to make a change, I make it in the file locally, then FTP to the scripts folder that I created. And, voila, it updates. No need for rebuilds or modifying templates now.

Sometime in the near future I'll be posting a HowTo that is more detailed on my blog.

Posted by Eric at August 9, 2005 05:10 AM
#2

OR... you could use an MT include statement and link to a "master sidebar" module. You would create a new module from your manage templates screen... it is the box at the bottom of the page... you might want to review the MT users manual foir explicit instructions.

Posted by Madfish Willie at August 9, 2005 05:03 PM
#3

You might try a search on MuNuviana for "php includes" or "MT includes"

Posted by Madfish Willie at August 9, 2005 05:05 PM
#4

Either way will work. The drawback to MT Includes is that you have to do a rebuild, so it wouldn't do what Michele wants.

Posted by Eric at August 10, 2005 05:56 AM
#5

Eric: Wouldn't the rebuilds be done after the next post if it wasn't done manually at the time of edit/save the template module? I don't remember doing manual rebuilds when I changed my modules, but it's been several months since I messed around with my templates, so....

Posted by Madfish Willie at August 10, 2005 03:15 PM
#6

I thought the rebuild during a post only affected the index page and the specific archives involved in the post?

Posted by Eric at August 12, 2005 01:43 AM
#7

Eric: Actually, if the MT include is in the template file, then after the first rebuild to change all the pages to the new template, just updating the include module would change all the related archive files. The rebuilt files would then just import the include module into the file for viewing. [I'm pretty sure this is the case]

Posted by Madfish Willie at August 13, 2005 01:28 AM
#8

Hmmmmm, I'll try it and find out. I just made a module change. Instead of doing a manual rebuild, I'll post something and let it rebuild.

Posted by Eric at August 13, 2005 08:13 PM
#9

Okay, I updated a module, then posted a new entry rather than doing a manual rebuild of everything. The rebuild while posting rebuilt my indexes, the individual archive and the date archive. It did not, however, rebuild all of the date and individual archives, only the ones containing the new post and it did not rebuild my category archives at all.

Posted by Eric at August 13, 2005 09:56 PM
Live Comment Preview
Post a comment









Remember personal info?