28 July 2006
Stupid Blogger Tricks Pt. 23
A quick tip if you use Blogger and host the blog yourself:
one of the reasons I switched from Blogger to Textpattern was the agony of staring at the spinning wheel stuck at 33, 45 or 78% for minutes when republishing the blog after a minor change in the template.
A simple workaround (if your configuration allows you to do this) is to include the sidebar via PHP from an external file:
(1) copy the code for your sidebar from your template into a file sidebar.php and upload it to your server.
(2) add AddType application/x-httpd-php .html somewhere in your .htaccess file – this will tell your server to parse the HTML pages Blogger generates as PHP.
(3) in your Blogger template: replace the code for your sidebar with the PHP code to include your external sidebar file, e.g.:
<? include("/path/to/sidebar.php") ?>
if you want to display a different sidebar for individual entries use sth. like
<MainOrArchivePage>
<? include("/path/to/sidebar.php") ?>
</MainOrArchivePage>
<ItemPage>
<? include("/path/to/sidebar_item.php") ?>
</ItemPage>
(4) republish
Now you can change your sidebar hassle-free and without the need to republish.
