So in a nutshell, the main control file of a template is the index.tpl file. This file is typically written in smarty syntax, so it's going to be a mix of html and smarty. This file can have whatever the original designer wanted it to have, and there's lots of different approaches so there's no universal answer to your question, but it could be as easy as in my case, simply checking for the existence of the static page title variable and not rendering that div if it exists. In the template I based my modification on, there was this originally:
Code: Select all
<div id="sidebar">
{serendipity_printSidebar side="right"}
{serendipity_printSidebar side="left"}
</div>
So I simply used the suggested title variable to suppress this block, using smarty's IF construct.
Code: Select all
{if !$staticpage_pagetitle}
<div id="sidebar">
{serendipity_printSidebar side="right"}
{serendipity_printSidebar side="left"}
</div>
{/if}
One other quick tip I can provide you, that's unrelated but that I utilized, and is fairly well know, is that a template can have a config.inc.php file, where you can add variables for use in the template files. In the same template I have a page that uses some javascript for a gallery. I only wanted to have this javascript injected on that page, and while there are other ways to do this with some plugins, I chose to just code it into the index.tpl.
So in the config.inc.php I grab the uri from php, and set a smarty template variable:
Code: Select all
$serendipity['smarty']->assign(array('curruri' => $_SERVER['REQUEST_URI']));
And in the index.tpl, in the section that emits the html head tag:
Code: Select all
{if $curruri == '/pages/photos.html'}
// Here is include an additional .css and some javascript code I need.
Hope these couple of tips steer you in the right direction. In case you weren't sure, the template files are all in serendipity main directory under the /templates/{template name} directory.
One last tip I can offer, just in general terms of working with smarty, is that smarty basically compiles the .tpl files into .php scripts. These compiled scripts go into the /templates_c directory. When you're modifying .tpl files, sometimes you can get some weird issues where smarty doesn't recompile the scripts. so it's good to know where the cached versions are. If you get into any issues where your changes are not showing up, just delete the cached files in the templates_c directory.